public void GetUnknownPartReturnsNull() { ModelUIPartList partList = new ModelUIPartList(); partList.AppendPart(new DummyPart("1")); partList.AppendPart(new DummyPart("2")); partList.AppendPart(new DummyPart("3")); var part = partList.GetPart("not in list"); Assert.IsNull(part); }
public void GetAppendedPartReturnsPart() { ModelUIPartList partList = new ModelUIPartList(); partList.AppendPart(new DummyPart("1")); partList.AppendPart(new DummyPart("2")); partList.AppendPart(new DummyPart("3")); for (var i = 1; i < 4; i++) { var part = partList.GetPart(i.ToString()); Assert.IsNotNull(part); Assert.AreEqual(i.ToString(), part.PartName); } }