public void ConvertToViewTest() { CompanyProvider target = new CompanyProvider(); // TODO: Initialize to an appropriate value Company item = _Company; baseCompanyView expected = _baseCompanyView; baseCompanyView actual; actual = target.ConvertToView(item); CompareViewObject(expected, actual); }
public void ConvertToModelTest() { CompanyProvider target = new CompanyProvider(); // TODO: Initialize to an appropriate value baseCompanyView item = _baseCompanyView; Company expected = _Company; Company actual; actual = target.ConvertToModel(item); CompareModelObject(expected, actual); }
public baseCompanyView GetCompany(int id) { QAManagement.Data.Services.CompanyService svc = new Data.Services.CompanyService(); Data.Services.DataContracts.Company item = svc.GetCompany(id); baseCompanyView view = new baseCompanyView(); view = this.ConvertToView(item); return(view); }
private static void CompareViewObject(baseCompanyView expected, baseCompanyView actual) { Assert.AreEqual(expected.ID, actual.ID); Assert.AreEqual(expected.Name, actual.Name); Assert.AreEqual(expected.Description, actual.Description); Assert.AreEqual(expected.ContactPerson, actual.ContactPerson); Assert.AreEqual(expected.ContactPersonNumber, actual.ContactPersonNumber); Assert.AreEqual(expected.ContactEmail, actual.ContactEmail); Assert.AreEqual(expected.Address1, actual.Address1); Assert.AreEqual(expected.Address2, actual.Address2); Assert.AreEqual(expected.Address3, actual.Address3); Assert.AreEqual(expected.PostalCode, actual.PostalCode); Assert.AreEqual(expected.OfficePhoneNumber, actual.OfficePhoneNumber); Assert.AreEqual(expected.OfficeEmail, actual.OfficeEmail); Assert.AreEqual(expected.Validated, actual.Validated); }
public baseCompanyView ConvertToView(Company item) { baseCompanyView view = new baseCompanyView(); view.ID = item.ID; view.Name = item.Name; view.Description = item.Description; view.ContactPerson = item.ContactPerson; view.ContactPersonNumber = item.ContactPersonNumber; view.ContactEmail = item.ContactEmail; view.Address1 = item.Address1; view.Address2 = item.Address2; view.Address3 = item.Address3; view.PostalCode = item.PostalCode; view.OfficePhoneNumber = item.OfficePhoneNumber; view.OfficeEmail = item.OfficeEmail; view.Validated = item.Validated; return(view); }
public Company ConvertToModel(baseCompanyView item) { Company model = new Company(); model.ID = item.ID; model.Name = item.Name; model.Description = item.Description; model.ContactPerson = item.ContactPerson; model.ContactPersonNumber = item.ContactPersonNumber; model.ContactEmail = item.ContactEmail; model.Address1 = item.Address1; model.Address2 = item.Address2; model.Address3 = item.Address3; model.PostalCode = item.PostalCode; model.OfficePhoneNumber = item.OfficePhoneNumber; model.OfficeEmail = item.OfficeEmail; model.Validated = item.Validated; return(model); }
public static void MyClassInitialize(TestContext testContext) { _Company = new Company() { ID = 1, Name = "1", Description = "1", ContactPerson = "1", ContactPersonNumber = "1", ContactEmail = "1", Address1 = "1", Address2 = "1", Address3 = "1", PostalCode = "1", OfficePhoneNumber = "1", OfficeEmail = "1", Validated = new DateTime(2012, 1, 1) }; _baseCompanyView = new baseCompanyView() { ID = 1, Name = "1", Description = "1", ContactPerson = "1", ContactPersonNumber = "1", ContactEmail = "1", Address1 = "1", Address2 = "1", Address3 = "1", PostalCode = "1", OfficePhoneNumber = "1", OfficeEmail = "1", Validated = new DateTime(2012, 1, 1) }; }