private void AssertDtoEqualToEntity(ConversationField entity, ConversationFieldDto dto) { Assert.NotNull(dto); Assert.Equal(entity.Id, dto.Id); Assert.Equal(entity.DataType, dto.DataType); Assert.Equal(entity.Name, dto.Name); Assert.Equal(entity.Options.First().FieldId, dto.Options.First().FieldId); Assert.Equal(entity.Options.First().Name, dto.Options.First().Name); Assert.Equal(entity.Options.First().Value, dto.Options.First().Value); Assert.Equal(entity.Options.First().Index, dto.Options.First().Index); }
public void ShouldGetFieldDtoById() { //Arrange var domainService = new Mock <IConversationFieldService>(); domainService.Setup(t => t.Find(1)).Returns(MakeConversationEntity(1)); ConversationFieldAppService conversationFieldAppService = new ConversationFieldAppService(domainService.Object); //Act ConversationFieldDto conversationDto = conversationFieldAppService.Find(1); //Assert Assert.NotNull(conversationDto); AssertDtoEqualToEntity(MakeConversationEntity(1), conversationDto); }