コード例 #1
0
 public void Verify_MapToSearchModel_AssignsImageFileSearchProperties()
 {
     // Arrange
     var mapper = new ImageFileMapper();
     var model = ImageFilesMockingSetup.DoMockingSetupForImageFileModel();
     // Act
     var searchModel = mapper.MapToSearchModel(model.Object);
     // Assert
 }
コード例 #2
0
 public void Verify_MapToModel_AssignsImageFileProperties()
 {
     // Arrange
     var mapper = new ImageFileMapper();
     var entity = ImageFilesMockingSetup.DoMockingSetupForImageFile();
     // Act
     var model = mapper.MapToModel(entity.Object);
     // Assert
     // <None>
     // Related Objects
     // <None>
     // Associated Objects
     Assert.Equal(entity.Object.Characters?.Count, model.Characters?.Count);
     Assert.Equal(entity.Object.Chats?.Count, model.Chats?.Count);
     Assert.Equal(entity.Object.Concepts?.Count, model.Concepts?.Count);
     Assert.Equal(entity.Object.Episodes?.Count, model.Episodes?.Count);
     Assert.Equal(entity.Object.Issues?.Count, model.Issues?.Count);
     Assert.Equal(entity.Object.Locations?.Count, model.Locations?.Count);
     Assert.Equal(entity.Object.Movies?.Count, model.Movies?.Count);
     Assert.Equal(entity.Object.Objects?.Count, model.Objects?.Count);
     Assert.Equal(entity.Object.People?.Count, model.People?.Count);
     Assert.Equal(entity.Object.Promos?.Count, model.Promos?.Count);
     Assert.Equal(entity.Object.Publishers?.Count, model.Publishers?.Count);
     Assert.Equal(entity.Object.StoryArcs?.Count, model.StoryArcs?.Count);
     Assert.Equal(entity.Object.Teams?.Count, model.Teams?.Count);
     Assert.Equal(entity.Object.Videos?.Count, model.Videos?.Count);
     Assert.Equal(entity.Object.Volumes?.Count, model.Volumes?.Count);
 }
コード例 #3
0
 public void Verify_MapToEntity_WithExistingEntity_AssignsImageFileProperties()
 {
     // Arrange
     var mapper = new ImageFileMapper();
     var model = ImageFilesMockingSetup.DoMockingSetupForImageFileModel();
     // Act
     IImageFile existingEntity = new ImageFile { Id = 1 };
     mapper.MapToEntity(model.Object, ref existingEntity);
     // Assert
     // <None>
     // Related Objects
     // <None>
     // Associated Objects
     model.VerifyGet(x => x.Characters, Times.Once);
     //Assert.Equal(model.Object.Characters?.Count, existingEntity.Characters?.Count);
     model.VerifyGet(x => x.Chats, Times.Once);
     //Assert.Equal(model.Object.Chats?.Count, existingEntity.Chats?.Count);
     model.VerifyGet(x => x.Concepts, Times.Once);
     //Assert.Equal(model.Object.Concepts?.Count, existingEntity.Concepts?.Count);
     model.VerifyGet(x => x.Episodes, Times.Once);
     //Assert.Equal(model.Object.Episodes?.Count, existingEntity.Episodes?.Count);
     model.VerifyGet(x => x.Issues, Times.Once);
     //Assert.Equal(model.Object.Issues?.Count, existingEntity.Issues?.Count);
     model.VerifyGet(x => x.Locations, Times.Once);
     //Assert.Equal(model.Object.Locations?.Count, existingEntity.Locations?.Count);
     model.VerifyGet(x => x.Movies, Times.Once);
     //Assert.Equal(model.Object.Movies?.Count, existingEntity.Movies?.Count);
     model.VerifyGet(x => x.Objects, Times.Once);
     //Assert.Equal(model.Object.Objects?.Count, existingEntity.Objects?.Count);
     model.VerifyGet(x => x.People, Times.Once);
     //Assert.Equal(model.Object.People?.Count, existingEntity.People?.Count);
     model.VerifyGet(x => x.Promos, Times.Once);
     //Assert.Equal(model.Object.Promos?.Count, existingEntity.Promos?.Count);
     model.VerifyGet(x => x.Publishers, Times.Once);
     //Assert.Equal(model.Object.Publishers?.Count, existingEntity.Publishers?.Count);
     model.VerifyGet(x => x.StoryArcs, Times.Once);
     //Assert.Equal(model.Object.StoryArcs?.Count, existingEntity.StoryArcs?.Count);
     model.VerifyGet(x => x.Teams, Times.Once);
     //Assert.Equal(model.Object.Teams?.Count, existingEntity.Teams?.Count);
     model.VerifyGet(x => x.Videos, Times.Once);
     //Assert.Equal(model.Object.Videos?.Count, existingEntity.Videos?.Count);
     model.VerifyGet(x => x.Volumes, Times.Once);
     //Assert.Equal(model.Object.Volumes?.Count, existingEntity.Volumes?.Count);
 }
コード例 #4
0
 public void Verify_MapToModelLite_AssignsLiteOnlyImageFileProperties()
 {
     // Arrange
     var mapper = new ImageFileMapper();
     var entity = ImageFilesMockingSetup.DoMockingSetupForImageFile();
     // Act
     var model = mapper.MapToModelLite(entity.Object);
     // Assert
     // <None>
     // Related Objects
     // <None>
 }
コード例 #5
0
 public void Verify_AreEqual_WithEqualObjects_ReturnsTrue()
 {
     // Arrange
     var mapper = new ImageFileMapper();
     var model = ImageFilesMockingSetup.DoMockingSetupForImageFileModel(1);
     var entity = ImageFilesMockingSetup.DoMockingSetupForImageFile(1);
     // Act
     var result = mapper.AreEqual(model.Object, entity.Object);
     // Assert
     Assert.True(result);
 }