public void Verify_Add_Should_AddTheEntityToTheContext()
 {
     // Arrange
     Mock<IDbSet<TeamStoryArc>> mockSetTeamStoryArcs;
     var mockContext = TeamStoryArcsMockingSetup.DoMockingSetupForContext(false, out mockSetTeamStoryArcs);
     var repository = new TeamStoryArcsRepository(mockContext.Object);
     var teamStoryArcs = new TeamStoryArc { Active = true, CustomKey = "SALVATORE-RAA", };
     // Act
     repository.Add(teamStoryArcs);
     // Assert
     mockSetTeamStoryArcs.Verify(x => x.Add(teamStoryArcs), Times.Once);
 }
        public void Verify_Add_Should_AddTheEntityToTheContext()
        {
            // Arrange
            Mock <IDbSet <TeamStoryArc> > mockSetTeamStoryArcs;
            var mockContext   = TeamStoryArcsMockingSetup.DoMockingSetupForContext(false, out mockSetTeamStoryArcs);
            var repository    = new TeamStoryArcsRepository(mockContext.Object);
            var teamStoryArcs = new TeamStoryArc {
                Active = true, CustomKey = "SALVATORE-RAA",
            };

            // Act
            repository.Add(teamStoryArcs);
            // Assert
            mockSetTeamStoryArcs.Verify(x => x.Add(teamStoryArcs), Times.Once);
        }
Exemplo n.º 3
0
        public void Verify_MapToEntity_WithExistingEntity_AssignsTeamStoryArcProperties()
        {
            // Arrange
            var mapper = new TeamStoryArcMapper();
            var model  = TeamStoryArcsMockingSetup.DoMockingSetupForTeamStoryArcModel();
            // Act
            ITeamStoryArc existingEntity = new TeamStoryArc {
                Id = 1
            };

            mapper.MapToEntity(model.Object, ref existingEntity);
            // Assert
            // <None>
            // Related Objects
            Assert.Equal(model.Object.TeamId, existingEntity.TeamId);
            Assert.Equal(model.Object.StoryArcId, existingEntity.StoryArcId);
            // Associated Objects
            // <None>
        }