public void GIVEN_a_warehouse_repo_WHEN_get_all_method_is_invoked_THEN_all_values_have_to_be_returned()
        {
            var firstAddResult   = _systemUnderTests.Add(_warehouseWithNoItems1);
            var secondAddResult  = _systemUnderTests.Add(_warehouseWithNoItems2);
            var warehouses       = _systemUnderTests.GetAll();
            var actualWarehouses = warehouses.ToArray();

            Assert.IsTrue(firstAddResult);
            Assert.IsTrue(secondAddResult);
            Assert.AreEqual(2, actualWarehouses.Length);
            Assert.AreEqual(_warehouseWithNoItems1.Name, actualWarehouses[0].Name);
            Assert.AreEqual(_warehouseWithNoItems2.Name, actualWarehouses[1].Name);
        }
예제 #2
0
        public void GIVEN_a_warehouse_repo_and_repo_filler_WHEN_fill_method_is_invoked_THEN_the_repo_has_to_be_populated_with_values()
        {
            _systemUnderTests.Fill(_items);
            var actualItems = _repo.GetAll()?.ToArray();

            Assert.IsNotNull(actualItems);
            Assert.AreEqual(2, actualItems.Length);
            Assert.AreEqual(_quantityItemOneWareHouseOne + _quantityItemTwoWareHouseOne, actualItems[0].Total);
            Assert.AreEqual(_quantityItemOneWareHouseTwo + _quantityItemTwoWareHouseTwo, actualItems[1].Total);
        }