Ejemplo n.º 1
0
        public void ValidSortMaterials()
        {
            //Arrange
            var stockSortService = new SortService();

            List <Material> materials = new List <Material>();

            Material firstMaterial = new Material();

            firstMaterial.MaterialId = "COM-123906c";
            firstMaterial.Amount     = 10;
            firstMaterial.Name       = "Generic Wire Pull";

            Material secondMaterial = new Material();

            secondMaterial.MaterialId = "COM-100001";
            secondMaterial.Amount     = 10;
            secondMaterial.Name       = "Cherry Hardwood Arched Door - PS";

            materials.Add(firstMaterial);
            materials.Add(secondMaterial);

            Warehouse warehouse = new Warehouse();

            warehouse.Name      = "WH-A";
            warehouse.Materials = materials;

            //Act
            stockSortService.SortMaterials(new Dictionary <string, Warehouse>()
            {
                { warehouse.Name, warehouse }
            });

            //Assert
            Assert.Equal(warehouse.Materials.FirstOrDefault(), secondMaterial);
        }