public void RetrieveTest_withValidID_AdditionalInfo(string value) { // Arrange AwardItem item = new AwardItem("_xx1", "Award"); item.BaseTableName = value; // Act int count = item.Retrieve(false); // Assert Assert.AreEqual(1, count); Assert.AreEqual("_xx1", item.ID); Assert.AreEqual("_xxx", item.Award.ID); Assert.AreEqual($"{value} Award Category X1", item.Category); Assert.AreEqual($"{value} Award Date X1", item.Date); Assert.AreEqual($"1", item.Winner); Assert.AreEqual($"{value} Award Details X1", item.Details); Assert.AreEqual("_xxx", item.Status.ID); Assert.AreEqual($"{value} Award LastUpdated X1", item.LastUpdated); Assert.AreEqual(3, item.Persons.Count); Assert.AreEqual("_x11", item.Persons[0].ID); Assert.AreEqual("_x12", item.Persons[1].ID); Assert.AreEqual("_x13", item.Persons[2].ID); }
public void RetrieveTest_withInvalidID_AdditionalInfo(string value) { // Arrange AwardItem item = new AwardItem("_aa1", "Award"); item.BaseTableName = value; // Act int count = item.Retrieve(false); // Assert Assert.AreEqual(0, count); Assert.AreEqual("_aa1", item.ID); Assert.IsNull(item.Award); Assert.IsNull(item.Category); Assert.IsNull(item.Date); Assert.IsNull(item.Winner); Assert.IsNull(item.Details); Assert.IsNull(item.Status); Assert.IsNull(item.LastUpdated); Assert.AreEqual(0, item.Persons.Count); }
public void RetrieveTest_withValidID_BasicInfoOnly(string value) { // Arrange AwardItem item = new AwardItem("_xx1", "Award"); item.BaseTableName = value; // Act int count = item.Retrieve(true); // Assert Assert.AreEqual(1, count); Assert.AreEqual("_xx1", item.ID); Assert.AreEqual("_xxx", item.Award.ID); Assert.AreEqual($"{value} Award Category X1", item.Category); Assert.AreEqual($"{value} Award Date X1", item.Date); Assert.AreEqual($"1", item.Winner); Assert.AreEqual($"{value} Award Details X1", item.Details); Assert.AreEqual("_xxx", item.Status.ID); Assert.AreEqual($"{value} Award LastUpdated X1", item.LastUpdated); Assert.IsNull(item.Persons); }