예제 #1
0
        public async Task InitialiseAsnc_Default_CallsInitialiseServiceAsync()
        {
            var mockService = new FakeService();

            mockService.StartTest();

            await mockService.InitialiseAsync();

            Assert.True(mockService.InitialiseServiceAsyncCalled);
        }
예제 #2
0
        public async Task DisposeAsync_NotInitialised_CallsDisposeServiceAsync()
        {
            var mockService = new FakeService();

            mockService.StartTest();

            await mockService.DisposeAsync();

            Assert.True(mockService.DisposeServiceAsyncCalled);
        }
예제 #3
0
        public async Task InitialiseAsnc_Disposed_DoesNotCallInitialiseServiceAsync()
        {
            var mockService = new FakeService();
            await mockService.DisposeAsync();

            mockService.StartTest();

            await mockService.InitialiseAsync();

            Assert.False(mockService.InitialiseServiceAsyncCalled);
        }
예제 #4
0
        public void Dispose_NotInitialised_CallsProtectedDisposeWithTrue()
        {
            var mockService = new FakeService();

            mockService.StartTest();

            mockService.Dispose();

            Assert.True(mockService.ProtectedDisposeCalled);
            Assert.True(mockService.ProtectedDisposeCallParameter);
        }
예제 #5
0
        public async Task DisposeAsync_NotInitialised_CallsProtectedDisposeWithFalse()
        {
            var mockService = new FakeService();

            mockService.StartTest();

            await mockService.DisposeAsync();

            Assert.True(mockService.ProtectedDisposeCalled);
            Assert.False(mockService.ProtectedDisposeCallParameter);
        }