public static void MyClassInitialize(TestContext testContext) { _Requirement = new Requirement() { ID = 1, Description = "1", LongDescription = "1", Number = "1", ProjectID = 1, SpecificationReference = "1", PassingDescription = "1", Weighting = 1, OwnedByUserID = 1 }; _baseRequirementView = new baseRequirementView() { ID = 1, Description = "1", LongDescription = "1", Number = "1", ProjectID = 1, SpecificationReference = "1", PassingDescription = "1", Weighting = 1, OwnedByUserID = 1 }; }
public void ConvertToViewTest() { RequirementProvider target = new RequirementProvider(); Requirement item = _Requirement; baseRequirementView expected = _baseRequirementView; baseRequirementView actual; actual = target.ConvertToView(item); CompareViewObject(expected, actual); }
public void ConvertToModelTest() { RequirementProvider target = new RequirementProvider(); baseRequirementView item = _baseRequirementView; Requirement expected = _Requirement; Requirement actual; actual = target.ConvertToModel(item); CompareModelObject(expected, actual); }
private static void CompareViewObject(baseRequirementView expected, baseRequirementView actual) { Assert.AreEqual(expected.ID, actual.ID); Assert.AreEqual(expected.Description, actual.Description); Assert.AreEqual(expected.LongDescription, actual.LongDescription); Assert.AreEqual(expected.Number, actual.Number); Assert.AreEqual(expected.ProjectID, actual.ProjectID); Assert.AreEqual(expected.SpecificationReference, actual.SpecificationReference); Assert.AreEqual(expected.PassingDescription, actual.PassingDescription); Assert.AreEqual(expected.Weighting, actual.Weighting); Assert.AreEqual(expected.OwnedByUserID, actual.OwnedByUserID); }
public baseRequirementView ConvertToView(Requirement item) { baseRequirementView view = new baseRequirementView(); view.ID = item.ID; view.Description = item.Description; view.LongDescription = item.LongDescription; view.Number = item.Number; view.ProjectID = item.ProjectID; view.SpecificationReference = item.SpecificationReference; view.PassingDescription = item.PassingDescription; view.Weighting = item.Weighting; view.OwnedByUserID = item.OwnedByUserID; return(view); }
public Requirement ConvertToModel(baseRequirementView item) { Requirement model = new Requirement(); model.ID = item.ID; model.Description = item.Description; model.LongDescription = item.LongDescription; model.Number = item.Number; model.ProjectID = item.ProjectID; model.SpecificationReference = item.SpecificationReference; model.PassingDescription = item.PassingDescription; model.Weighting = item.Weighting; model.OwnedByUserID = item.OwnedByUserID; return(model); }