public void ShouldAddSomeCustomer() { CustomerId = Guid.NewGuid(); var model = CustomerBuilder.New().WithId(CustomerId).Build(); var ret = customerWriteOnlyRepository.Add(model); ret.Should().Be(1); }
public void ShouldAddSomeCustomer() { var model = CustomerBuilder.New().Build(); CustomerId = model.Id; var ret = customerWriteOnlyRepository.Add(model); ret.Should().Be(1); }
public void ShouldUpdateCustomer() { var model = customerReadOnlyRepository.GetById(idCustomer); model.Should().NotBeNull(); var newModel = CustomerBuilder.New().WithId(model.Id).WithName("NewCustomer").Build(); customerWriteOnlyRepository.Update(newModel); }
public void ShouldAddManyCustomers() { var models = new List <Customer>() { CustomerBuilder.New().Build(), CustomerBuilder.New().Build(), CustomerBuilder.New().Build() }; var ret = customerWriteOnlyRepository.Add(models); ret.Should().Be(1); }
public IList <Customer> GetCustomers() { //simulate database operation var alfredo = CustomerBuilder.New().WithFullName("Alfredo Landa").Build(); var luis = CustomerBuilder.New().WithFullName("Luis Landero").Build(); return(new List <Customer> { alfredo, luis }); }
public void ShouldAddSomeCustomers() { var models = new List <DemoCleanArchitecture.Domain.Customer.Customer>() { CustomerBuilder.New().Build(), CustomerBuilder.New().Build(), CustomerBuilder.New().Build() }; var ret = customerWriteOnlyRepository.Add(models); ret.Should().Be(1); }
public void ShouldNotCreateDomainWithAgeNullOrEmpty(int age) { var model = CustomerBuilder.New().WithAge(age).Build(); model.IsValid.Should().BeFalse(); }
public void ShouldNotCreateDomainWithCustomerNameNullOrEmpty(string name) { var model = CustomerBuilder.New().WithName(name).Build(); model.IsValid.Should().BeFalse(); }
public void ShouldNotCreateDomainWithIdNullOrEmpty() { var model = CustomerBuilder.New().WithId(new Guid()).Build(); model.IsValid.Should().BeFalse(); }
public void ShouldCreateDomain() { var model = CustomerBuilder.New().Build(); model.IsValid.Should().BeTrue(); }
public void Should_Not_Create_A_Customer_Without_Email() { Assert.Throws <DomainException>(() => CustomerBuilder.New().WithEmail(null).Build()) .WithMessage("Email is required"); }
public void Should_Not_Create_A_Customer_Without_StreetAddress() { Assert.Throws <DomainException>(() => CustomerBuilder.New().WithStreetAddress(null).Build()) .WithMessage("Street Address is required"); }
public void customer_name_should_not_be_null_or_empty(string name) { Assert.Throws <ArgumentException>(() => CustomerBuilder.New().WithName(name).Build()).WithMessage(ExceptionMessage.DOMAIN_CUSTOMER_NAME_INVALID); }
public void customer_email_should_not_be_null_or_empty(string email) { Assert.Throws <ArgumentException>(() => CustomerBuilder.New().WithEmail(email).Build()).WithMessage(ExceptionMessage.DOMAIN_CUSTOMER_EMAIL_INVALID); }
public void ShouldNotCreateDomainWithNameLengthBiggerThan200(string name) { var model = CustomerBuilder.New().WithName(name).Build(); model.IsValid.Should().BeFalse(); }
public void ShouldNotCreateDomainWithEmailLengthBiggerThan100(string email) { var model = CustomerBuilder.New().WithEmail(email).Build(); model.IsValid.Should().BeFalse(); }
public void Should_Not_Create_A_Customer_Without_DocumentNumber() { Assert.Throws <DomainException>(() => CustomerBuilder.New().WithDocumentNumber(null).Build()) .WithMessage("Document Number is required"); }