public void Verify_MapToEntity_WithExistingEntity_AssignsConceptAliasProperties() { // Arrange var mapper = new ConceptAliasMapper(); var model = ConceptAliasesMockingSetup.DoMockingSetupForConceptAliasModel(); // Act IConceptAlias existingEntity = new ConceptAlias { Id = 1 }; mapper.MapToEntity(model.Object, ref existingEntity); // Assert // <None> // Related Objects Assert.Equal(model.Object.ConceptId, existingEntity.ConceptId); // Associated Objects // <None> }
public void Verify_Add_Should_AddTheEntityToTheContext() { // Arrange Mock <IDbSet <ConceptAlias> > mockSetConceptAliases; var mockContext = ConceptAliasesMockingSetup.DoMockingSetupForContext(false, out mockSetConceptAliases); var repository = new ConceptAliasesRepository(mockContext.Object); var conceptAliases = new ConceptAlias { Active = true, CustomKey = "SALVATORE-RAA", }; // Act repository.Add(conceptAliases); // Assert mockSetConceptAliases.Verify(x => x.Add(conceptAliases), Times.Once); }