DRMFSS.Test.CommodityRepositoryTest.Get_All_Sub_Commodities_Test C# (CSharp) Method

Get_All_Sub_Commodities_Test() private method

private Get_All_Sub_Commodities_Test ( ) : void
return void
        public void Get_All_Sub_Commodities_Test()
        {
            //Commodity target = new Commodity(); // TODO: Initialize to an appropriate value
            List<Commodity> expected = new List<Commodity>
                {
                    new Commodity { CommodityID = 5, Name = "Yellow Wheat",LongName = "",CommodityTypeID = 1, ParentID = 1 },
                    new Commodity { CommodityID = 7, Name = "Green Wheat",LongName = "",CommodityTypeID = 1, ParentID = 1 },
                    new Commodity { CommodityID = 8, Name = "Beans",LongName = "",CommodityTypeID = 1, ParentID = 3 },
               };

            List<Commodity> actual = this.MockCommodityRepository.GetAllSubCommodities();

            Assert.IsInstanceOfType(actual, expected.GetType()); // Test type
            Assert.AreEqual(actual.Count, expected.Count);
            //are all elemetnts found
            foreach (var commodityExp in expected)
            {
                Assert.IsTrue(actual.Contains(actual.Find(c => c.CommodityID == commodityExp.CommodityID)));
            }

            //Assert.AreEqual(expected, actual);
        }