コード例 #1
0
        public void Save_CallsSave_WhenCalled([NotNull, Frozen] ITestContext context,
                                              [NotNull] TestBaseRepository sut)
        {
            // Arrange
            // Act
            sut.Save();

            // Assert
            context.Received().SaveChanges();
        }
コード例 #2
0
        public void AddOrUpdate_CallsAdds_ForDayWithDefaultId([NotNull] ITest test,
                                                              [NotNull, Frozen] ITestContext context,
                                                              [NotNull] TestBaseRepository sut)
        {
            // Arrange
            test.Id.Returns(0);

            // Act
            sut.Save(test);

            // Assert
            context.Received().Add(test);
        }
コード例 #3
0
        public void AddOrUpdate_CallsSetStateForSlot_ForExistingDay([NotNull] ITest test,
                                                                    [NotNull, Frozen] ITestContext context,
                                                                    [NotNull] TestBaseRepository sut)
        {
            // Arrange
            test.Id.Returns(1);

            // Act
            sut.Save(test);

            // Assert
            context.Received().SetStateForSlot(test,
                                               EntityState.Modified);
        }
コード例 #4
0
 private void ThenICanStillUseNSubsitute()
 {
     _subsitute.Received().Examples = _exampleTable;
 }