예제 #1
0
        public void ContractAggregate_ShouldBeDeleted()
        {
            //Arrange
            var request  = AggregatesRequestBuilder.CreateRandomContractCreateRequest();
            var contract = ContractAggregate.CreateFromRequest(request);

            //Act
            contract.MarkAsDeleted();

            //Assert
            contract.IsDeleted.Should().BeTrue();
        }
예제 #2
0
        public void ContractAggregate_UpdateRandomFromRequest()
        {
            //Arrange
            var createRequest = AggregatesRequestBuilder.CreateRandomContractCreateRequest();
            var contract      = ContractAggregate.CreateFromRequest(createRequest);
            var updateRequest = AggregatesRequestBuilder.CreateRandomContractUpdateRequest();

            //Act
            contract.UpdateFromRequest(updateRequest);

            // Assert
            contract.Title.Should().Be(updateRequest.Title);
            contract.Description.Should().Be(updateRequest.Description);
        }
예제 #3
0
        public void ContractAggregate_CreateRandomFromRequest()
        {
            //Arrange
            var request = AggregatesRequestBuilder.CreateRandomContractCreateRequest();

            //Act
            var contract = ContractAggregate.CreateFromRequest(request);

            // Assert
            contract.Title.Should().Be(request.Title);
            contract.DateStart.Should().Be(request.DateStart);
            contract.DateEnd.Should().Be(request.DateEnd);
            contract.Description.Should().Be(request.Description);
            contract.IsDeleted.Should().BeFalse();
        }