예제 #1
0
    private Customer CreateSomeCustomer()
    {
        var fullName     = new FullName(JohnSmith.FirstName, JohnSmith.LastName);
        var nationalCode = new NationalCode(JohnSmith.NationalCode);

        return(new Customer(fullName, nationalCode, Clock));
    }
        private Customer MapToCustomer(RegisterCustomerCommand command)
        {
            var fullName     = new FullName(command.FirstName, command.LastName);
            var nationalCode = new NationalCode(command.NationalCode);

            return(new Customer(fullName, nationalCode, _clock));
        }
예제 #3
0
파일: Customer.cs 프로젝트: SabaCell/Nike
 /// <inheritdoc />
 public Customer(FullName fullName, NationalCode nationalCode, IClock clock)
 {
     Id           = Guid.NewGuid();
     FullName     = fullName;
     NationalCode = nationalCode;
     IsActive     = true;
     CreatedAt    = clock.Now();
 }
예제 #4
0
 /// <inheritdoc />
 public Customer(FullName fullName, NationalCode nationalCode, IClock clock)
 {
     this.Id           = Guid.NewGuid();
     this.FullName     = fullName;
     this.NationalCode = nationalCode;
     this.IsActive     = true;
     this.CreatedAt    = clock.Now();
 }
예제 #5
0
    public void Should_be_able_to_register_new_customer()
    {
        Clock.Adjust(new DateTime(2020, 01, 01));
        var fullName     = new FullName(JohnSmith.FirstName, JohnSmith.LastName);
        var nationalCode = new NationalCode(JohnSmith.NationalCode);

        var customer = new Customer(fullName, nationalCode, Clock);

        customer.Id.Should().NotBeEmpty();
        customer.FullName.Should().Be(fullName);
        customer.NationalCode.Should().Be(nationalCode);
        customer.CreatedAt.Should().Be(Clock.Now());
    }
 internal Employee(Guid id, FullName fullName, NationalCode nationalCode) : base(id)
 {
     this.FullName     = fullName;
     this.NationalCode = nationalCode;
 }
 /// <inheritdoc />
 public Employee(FullName fullName, NationalCode nationalCode) : base(Guid.NewGuid())
 {
     this.FullName     = fullName;
     this.NationalCode = nationalCode;
 }
예제 #8
0
 public WhatsappNumber(NationalCode country_code, string Number)
     : this(Number)
 {
     nationalCode = country_code;
 }