コード例 #1
0
        public void ServiceAggregate_ShouldBeDeleted()
        {
            //Arrange
            var request = AggregatesRequestBuilder.CreateRandomServiceRequest();
            var service = ServiceAggregate.CreateFromRequest(request);

            //Act
            service.MarkAsDeleted();

            //Assert
            service.IsDeleted.Should().BeTrue();
        }
コード例 #2
0
        public void ServiceAggregate_CreateRandomFromRequest()
        {
            //Arrange
            var request = AggregatesRequestBuilder.CreateRandomServiceRequest();

            //Act
            var service = ServiceAggregate.CreateFromRequest(request);

            // Assert
            service.Name.Should().Be(request.Name);
            service.IsDeleted.Should().BeFalse();
        }
コード例 #3
0
        public void ServiceAggregate_UpdateRandomFromRequest()
        {
            //Arrange
            var createRequest = AggregatesRequestBuilder.CreateRandomServiceRequest();
            var service       = ServiceAggregate.CreateFromRequest(createRequest);
            var updateRequest = AggregatesRequestBuilder.CreateRandomServiceRequest();

            //Act
            service.UpdateFromRequest(updateRequest);

            // Assert
            service.Name.Should().Be(updateRequest.Name);
        }