Пример #1
0
        public void InventoryContainsTest()
        {
            var shark = new Library.Animal();

            shark.Name = "shark";
            var nyc = new Library.Store();

            nyc.Inventory = new Dictionary <Library.Animal, int>();
            nyc.AddToInventory(shark, 20);
            var actual = nyc.InInventory(shark);

            Assert.True(actual == true);
        }
Пример #2
0
        public void RemoveFromInventoryTest2()
        {
            var penguin = new Library.Animal();

            penguin.Name = "penguin";
            var nyc = new Library.Store();

            nyc.Inventory = new Dictionary <Library.Animal, int>();
            nyc.AddToInventory(penguin, 20);
            var actual = nyc.RemoveFromInventory(penguin, 100);

            Assert.True(actual == false);
        }
Пример #3
0
        public void AddInventoryTestFail()
        {
            var shark = new Library.Animal();

            shark.Name = "shark";
            var nyc = new Library.Store();

            nyc.Inventory = new Dictionary <Library.Animal, int>();
            nyc.AddToInventory(shark, 0);
            var actual = nyc.InInventory(shark);

            Assert.True(actual == false);
        }
Пример #4
0
        public void AddToInventoryTest2()
        {
            // Arrange
            var penguin = new Library.Animal();

            penguin.Name = "penguin";
            var nyc = new Library.Store();

            nyc.Inventory = new Dictionary <Library.Animal, int>();
            nyc.AddToInventory(penguin, 1555);
            // Act
            var actual = nyc.Inventory[penguin];

            // Assert
            Assert.True(actual == 1555);
        }
Пример #5
0
        public void AddToInventoryTest()
        {
            // Arrange
            var newAnimal = new Library.Animal();

            newAnimal.Name = "whale";
            var nyc = new Library.Store();

            nyc.Inventory = new Dictionary <Library.Animal, int>();
            // Act
            nyc.AddToInventory(newAnimal, 5);
            // Assert
            var actual = nyc.Inventory[newAnimal];

            Assert.True(actual == 5);
        }