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

Get_All_Parents_Test() private method

private Get_All_Parents_Test ( ) : void
return void
        public void Get_All_Parents_Test()
        {
            //Commodity target = new Commodity(); // TODO: Initialize to an appropriate value
            List<Commodity> expected = new List<Commodity>
                {
                    new Commodity { CommodityID = 1, Name = "Wheat",LongName = "",CommodityTypeID = 1, ParentID = null },
                    new Commodity { CommodityID = 3, Name = "CSB",LongName = "",CommodityTypeID = 1, ParentID = null },
               };

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

            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);
        }