public void Map_EntityDtoToEntity_Is_Null(TodoDto dto, TodoEntity entity)
        {
            // Arrange
            var mapper = new TodoDtoEntityMapper();

            // Act
            TodoEntity result = mapper.Map(dto, entity);

            // Assert
            result.Should().BeNull();
        }
        public void Map_EntityToDto_Is_Valid()
        {
            // Arrange
            var        mapper = new TodoDtoEntityMapper();
            TodoEntity entity = TodoEntityBuilder.CreateValid(TestIds.NormalUsageId);

            // Act
            TodoDto result = mapper.Map(entity);

            // Assert
            result.Should().BeEquivalentTo(entity);
        }
        public void Map_DtoToEntity_Is_Null()
        {
            // Arrange
            var     mapper = new TodoDtoEntityMapper();
            TodoDto dto    = null;

            // Act
            TodoEntity result = mapper.Map(dto);

            // Assert
            result.Should().BeNull();
        }
        public void Map_List_EntityToDto_Is_Null()
        {
            // Arrange
            var mapper = new TodoDtoEntityMapper();
            IReadOnlyList <TodoEntity> entities = null;

            // Act
            IEnumerable <TodoDto> result = mapper.Map(entities);

            // Assert
            result.Should().BeNull();
        }
        public void Map_EntityToDto_Is_Null()
        {
            // Arrange
            var        mapper = new TodoDtoEntityMapper();
            TodoEntity entity = null;

            // Act
            TodoDto result = mapper.Map(entity);

            // Assert
            result.Should().BeNull();
        }
        public void Map_DtoToEntity_Is_Valid()
        {
            // Arrange
            var     mapper = new TodoDtoEntityMapper();
            TodoDto dto    = TodoDtoBuilder.CreateValid(TestIds.NormalUsageId);

            // Act
            TodoEntity result = mapper.Map(dto);

            // Assert
            result.Should().BeEquivalentTo(dto, options => options.Excluding(o => o.Id));
            result.Id.Should().Be(Guid.Empty);
        }
        public void Map_List_EntityToDto_Is_Valid()
        {
            // Arrange
            var mapper = new TodoDtoEntityMapper();
            IReadOnlyList <TodoEntity> entities = new List <TodoEntity> {
                TodoEntityBuilder.CreateValid(TestIds.NormalUsageId)
            };

            // Act
            IEnumerable <TodoDto> result = mapper.Map(entities);

            // Assert
            result.Should().BeEquivalentTo(result);
        }