Exemple #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);
        }
        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();
        }