Esempio n. 1
0
        public async Task <Guid> Create(ClientCreateRequest request)
        {
            var client = ClientAggregate.CreateFromRequest(request);

            await _repo.Add(client);

            return(client.Id);
        }
Esempio n. 2
0
        public void ClientAggregate_CreateRandomFromRequest()
        {
            //Arrange
            var request = AggregatesRequestBuilder.CreateRandomClientCreateRequest();

            //Act
            var client = ClientAggregate.CreateFromRequest(request);

            // Assert
            client.UserId.Should().Be(request.UserId);
            client.IsDeleted.Should().BeFalse();
        }
Esempio n. 3
0
        public void ClientAggregate_ShouldBeDeleted()
        {
            //Arrange
            var request = AggregatesRequestBuilder.CreateRandomClientCreateRequest();
            var client  = ClientAggregate.CreateFromRequest(request);

            //Act
            client.MarkAsDeleted();

            //Assert
            client.IsDeleted.Should().BeTrue();
        }