Example #1
0
        public async Task InitialiseAsnc_Initialised_DoesNotCallInitialiseServiceAsync()
        {
            var mockService = new FakeService();
            await mockService.InitialiseAsync();

            mockService.StartTest();

            await mockService.InitialiseAsync();

            Assert.False(mockService.InitialiseServiceAsyncCalled);
        }
Example #2
0
        public async Task CheckValidState_Initialised_DoesNotThrow()
        {
            var mockService = new FakeService();
            await mockService.InitialiseAsync();

            mockService.CheckValidState();
        }
Example #3
0
        public async Task InitialiseAsnc_Default_CallsInitialiseServiceAsync()
        {
            var mockService = new FakeService();

            mockService.StartTest();

            await mockService.InitialiseAsync();

            Assert.True(mockService.InitialiseServiceAsyncCalled);
        }
Example #4
0
        public async Task DisposeAsync_Initialised_CallsDisposeServiceAsync()
        {
            var mockService = new FakeService();
            await mockService.InitialiseAsync();

            mockService.StartTest();

            await mockService.DisposeAsync();

            Assert.True(mockService.DisposeServiceAsyncCalled);
        }
Example #5
0
        public async Task Dispose_Initialised_CallsProtectedDisposeWithTrue()
        {
            var mockService = new FakeService();
            await mockService.InitialiseAsync();

            mockService.StartTest();

            mockService.Dispose();

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