Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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();
        }