Esempio n. 1
0
 public void ExecuteSample()
 {
     if (_sampleService.CanExecute)
     {
         _sampleService.Execute();
     }
 }
Esempio n. 2
0
        public void SampleProvider_Execute_Succeeds(
            ISampleService sampleService)
        {
            A.CallTo(() => sampleService.CanExecute)
            .Returns(true);

            var sampleProvider = new SampleProvider(sampleService);

            sampleProvider.ExecuteSample();

            A.CallTo(() => sampleService.Execute())
            .MustHaveHappened(Repeated.Exactly.Once);
        }
Esempio n. 3
0
        public void SampleProvider_Execute_Succeeds(
            ISampleService sampleService)
        {
            // Arrange
            A.CallTo(() => sampleService.CanExecute)
            .Returns(true);
            var sampleProvider = new SampleProvider(sampleService);

            // Act
            sampleProvider.ExecuteSample();

            // Assert
            A.CallTo(() => sampleService.Execute())
            .MustHaveHappenedOnceExactly();
        }