Exemplo n.º 1
0
        public void LookupPrice_WhenMilk_ReturnsPrice()
        {
            var sut = new ItemCatalogue();

            Assert.That(sut.LookupPrice("Milk"), Is.EqualTo(1.15m));
        }
Exemplo n.º 2
0
        public void LookupPrice_WhenButter_ReturnsPrice()
        {
            var sut = new ItemCatalogue();

            Assert.That(sut.LookupPrice("Butter"), Is.EqualTo(0.80m));
        }
Exemplo n.º 3
0
        public void LookupPrice_WhenNoSuchItem_ThrowsException()
        {
            var sut = new ItemCatalogue();

            Assert.Throws <NoSuchItemException>(() => sut.LookupPrice("No such item"));
        }
Exemplo n.º 4
0
        public void LookupPrice_WhenBread_ReturnsPrice()
        {
            var sut = new ItemCatalogue();

            Assert.That(sut.LookupPrice("Bread"), Is.EqualTo(1.00m));
        }
Exemplo n.º 5
0
        public void LookupPrice_WhenNullOrEmpty_ThrowsException(string item)
        {
            var sut = new ItemCatalogue();

            Assert.Throws <ArgumentNullException>(() => sut.LookupPrice(item));
        }