public void Convert__EmployeeFullImportModelIn_EmployeeOut__ReturnsEmployeeWithExpectedValues() { // Arrange: var converter = new ImportModelConverter <EmployeeFullImportModel, Employee>(new ImportModelVisitor()); var employeeFullImportModel = new EmployeeFullImportModel() { EmployeeId = "AR12345", EmployeeName = "Вася Пупкин", IsActive = true, Position = "пр", Appointment = "кл", Rank = 5, }; // Action: var employee = converter.Convert(employeeFullImportModel); // Assert: Assert.That(employee.GetType().IsAssignableFrom(typeof(Employee))); Assert.That("AR12345".Equals(employee.Id)); Assert.That("Вася Пупкин".Equals(employee.Name)); Assert.That(true == employee.IsActive); Assert.That("пр".Equals(employee.Position.Abbreviation)); Assert.That("кл".Equals(employee.Appointment.Abbreviations)); Assert.That(5 == employee.Rank.Number); }
public void Convert__GatheringImportModelIn_GatheringActionOut__ReturnsGatheringAction() { // Arrange: var converter = new ImportModelConverter <GatheringImportModel, GatheringAction>(GetMockedVisitor()); var gatheringImportModel = new GatheringImportModel(); // Action: var gatheringAction = converter.Convert(gatheringImportModel); // Assert: Assert.That(gatheringAction.GetType().IsAssignableFrom(typeof(GatheringAction))); }
public void Convert__EmployeeFullImportModelIn_EmployeeOut__ReturnsEmployee() { // Arrange: var converter = new ImportModelConverter <EmployeeFullImportModel, Employee>(GetMockedVisitor()); var employeeFullImportModel = new EmployeeFullImportModel(); // Action: var employee = converter.Convert(employeeFullImportModel); // Assert: Assert.That(employee.GetType().IsAssignableFrom(typeof(Employee))); }
public void Convert__ProductImportModelIn_ProductOut__ReturnsProduct() { // Arrange: var converter = new ImportModelConverter <ProductImportModel, Product>(GetMockedVisitor()); var productImportModel = new ProductImportModel(); // Action: var product = converter.Convert(productImportModel); // Assert: Assert.That(product.GetType().IsAssignableFrom(typeof(Product))); }
public void Convert__ProductImportModelIn_ProductOut__ReturnsProduct() { // Arrange: var converter = new ImportModelConverter <ProductImportModel, Product>(new ImportModelVisitor()); var productImportModel = new ProductImportModel { Id = 7123, Name = "Product A", Weight = 1.123 }; // Action: var product = converter.Convert(productImportModel); // Assert: Assert.That(product.GetType().IsAssignableFrom(typeof(Product))); Assert.That(7123 == product.Id); Assert.That(product.Name.Equals("Product A")); Assert.That(product.ItemWeight.Equals(( float )1.123)); }