public void TestGetDescriptionOverloading() { string title = "LG"; string model = "G3S"; Gadget testGadget = new Gadget(model, new VideoPort[0]); testGadget.Title = title; string expectedFormat = Gadget.DescriptionFormat; string result = testGadget.GetDescription(); string expectedResult = String.Format(expectedFormat, title, model); Assert.AreEqual(result, expectedResult); }
public void TestGetDescription() { string title = "MSI"; string model = "CX70 2PF"; Gadget testGadget = new Gadget(model, new VideoPort[0]); testGadget.Title = title; string expectedFormat = "Gadget: {0}, model: {1}"; string result = testGadget.GetDescription(expectedFormat); string expectedResult = String.Format(expectedFormat, title, model); Assert.AreEqual(result, expectedResult); }