public async Task <Guid> Create(EmployeeCreateRequest request) { var employee = EmployeeAggregate.CreateFromRequest(request); await _repo.Add(employee); return(employee.Id); }
public void EmployeeAggregate_CreateRandomFromRequest() { //Arrange var request = AggregatesRequestBuilder.CreateRandomEmployeeCreateRequest(); //Act var employee = EmployeeAggregate.CreateFromRequest(request); // Assert employee.UserId.Should().Be(request.UserId); employee.IsDeleted.Should().BeFalse(); }
public void EmployeeAggregate_ShouldBeDeleted() { //Arrange var request = AggregatesRequestBuilder.CreateRandomEmployeeCreateRequest(); var employee = EmployeeAggregate.CreateFromRequest(request); //Act employee.MarkAsDeleted(); //Assert employee.IsDeleted.Should().BeTrue(); }