public static bool ActiveCustomerIsValidToImport(Customer customer) { return (customer.Id != Guid.Empty && customer.Name == CUSTOMER_NAME && customer.BirthDate.GetValueOrDefault().Date == DateTime.UtcNow.AddYears(-CUSTOMER_YEARS_OLD).Date && TenantInfoValueObjectTest.IsValid(customer.TenantInfo) && AuditableInfoValueObjectTest.IsValidForCreation(customer.AuditableInfo) && ActivationInfoValueObjectTest.IsValidForActivation(customer.ActivationInfo) ); }
public async Task Order_ImportOrder_Success() { _ = await RunWithTelemetryAsync( totalOfExecutions : 1, runInParallel : false, handler : async execution => { #region Arrange var order = default(Order); #endregion #region Act order = CreateDefaultImportOrder(); #endregion #region Assert return(await Task.FromResult( order.Code == ORDER_CODE && order.OrderDate >= DateTime.UtcNow.AddSeconds(-10) && order.OrderStatus.Status == OrderStatusEnum.Open && TenantInfoValueObjectTest.IsValid(order.TenantInfo) && AuditableInfoValueObjectTest.IsValidForCreation(order.AuditableInfo) && ValidateOrderCustomer(order) && ValidateOrderShipping(order) && ValidateOrderItemCollection(order) ).ConfigureAwait(false)); #endregion } ).ConfigureAwait(false); }
public async Task Product_ImportProduct_Inactive_Success() { _ = await RunWithTelemetryAsync( totalOfExecutions : 1, runInParallel : false, handler : async execution => { #region Arrange var product = default(Product); #endregion #region Act product = CreateDefaultImportProduct(false); #endregion #region Assert return(await Task.FromResult( product.Id != Guid.Empty && product.Code == PRODUCT_CODE && product.Name == PRODUCT_NAME && product.Description == PRODUCT_DESCRIPTION && TenantInfoValueObjectTest.IsValid(product.TenantInfo) && AuditableInfoValueObjectTest.IsValidForCreation(product.AuditableInfo) && ActivationInfoValueObjectTest.IsValidForInactivation(product.ActivationInfo) ).ConfigureAwait(false)); #endregion } ).ConfigureAwait(false); }