public void WhenWeHaveASourceObject_ThenWeCanMapToADestinationObject() { var entity = new ExampleEntity { Id = Guid.NewGuid() }; var mapper = new ExampleEntityMapper(); var dto = mapper.Map(entity); Assert.Equal(entity.Id, dto.Id); }
public void WhenWeRequestAnExampleDtoForAnId_ThenWeRetrieveTheIdUsingOwnMapper() { //DI MAGIC var mapper = new ExampleEntityMapper(); var exampleController = new ExampleController(new FakeRepository(), mapper); //END DI Magic var id = Guid.NewGuid(); var dto = exampleController.Get(id); Assert.Equal(id, dto.Id); }