Exemple #1
0
        public void Create_new_computer()
        {
            ComputersController computersController = new ComputersController();
            int numberOfComputers = computersController.All().Count;

            _managementController.AddComputer(new AddComputerDto
            {
                Name          = "TestComputer",
                Description   = "New computer",
                Price         = 1500,
                ImageFilename = "test.png"
            });

            var allComputers             = computersController.All();
            int currentNumberOfComputers = allComputers.Count;

            Assert.AreEqual(numberOfComputers + 1, currentNumberOfComputers);
            Assert.IsNotNull(allComputers.First(comp => comp.Name == "TestComputer"));
        }