<commit_before>﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Vending.Core;

namespace Vending.Tests.Core
{
    [TestClass]
    public class SoldOutTests
    {
        [TestMethod]
        public void VendingMachine_WhenSoldOutAndNoMoneyInserted_DisplaysSoldOutThenInsertCoin()
        {
            var fakeProductInfoRepository = new FakeProductInfoRepository() { QuantityAvailable = 0 };
            var vendingMachine = new VendingMachine(fakeProductInfoRepository);

            vendingMachine.Dispense("candy");

            Assert.AreEqual("SOLD OUT", vendingMachine.GetDisplayText());
            Assert.AreEqual("INSERT COIN", vendingMachine.GetDisplayText());
        }

        [Ignore]
        [TestMethod]
        public void VendingMachine_WhenSoldOutAndMoneyIsInMachine_DisplaySoldOutThenCurrentAmount()
        {
            var fakeProductInfoRepository = new FakeProductInfoRepository() { QuantityAvailable = 0, Price = 65 };
            var vendingMachine = new VendingMachine(fakeProductInfoRepository);

            vendingMachine.Dispense("candy");

            Assert.AreEqual("SOLD OUT", vendingMachine.GetDisplayText());
            Assert.AreEqual("$0.65", vendingMachine.GetDisplayText());
        }
    }
}
<commit_msg>When sold out and money is in the machine, current value is displayed.<commit_after>﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Vending.Core;

namespace Vending.Tests.Core
{
    [TestClass]
    public class SoldOutTests
    {
        [TestMethod]
        public void VendingMachine_WhenSoldOutAndNoMoneyInserted_DisplaysSoldOutThenInsertCoin()
        {
            var fakeProductInfoRepository = new FakeProductInfoRepository() { QuantityAvailable = 0 };
            var vendingMachine = new VendingMachine(fakeProductInfoRepository);

            vendingMachine.Dispense("candy");

            Assert.AreEqual("SOLD OUT", vendingMachine.GetDisplayText());
            Assert.AreEqual("INSERT COIN", vendingMachine.GetDisplayText());
        }

        [TestMethod]
        public void VendingMachine_WhenSoldOutAndMoneyIsInMachine_DisplaySoldOutThenCurrentAmount()
        {
            var fakeProductInfoRepository = new FakeProductInfoRepository() { QuantityAvailable = 0, Price = 65 };
            var vendingMachine = new VendingMachine(fakeProductInfoRepository);

            vendingMachine.Accept(Coin.Quarter);
            vendingMachine.Dispense("candy");

            Assert.AreEqual("SOLD OUT", vendingMachine.GetDisplayText());
            Assert.AreEqual("$0.25", vendingMachine.GetDisplayText());
        }
    }
}

{'fraction_non_alphanumeric': 0.08614800759013283, 'fraction_numerical': 0.005313092979127135, 'mean_word_length': 3.170886075949367, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '673951', 'n_tokens_mistral': 717, 'n_tokens_neox': 688, 'n_words': 124}