コード例 #1
0
        public async Task InitialiseAsnc_Initialised_DoesNotCallInitialiseServiceAsync()
        {
            var mockService = new FakeService();
            await mockService.InitialiseAsync();

            mockService.StartTest();

            await mockService.InitialiseAsync();

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

            mockService.CheckValidState();
        }
コード例 #3
0
        public async Task InitialiseAsnc_Default_CallsInitialiseServiceAsync()
        {
            var mockService = new FakeService();

            mockService.StartTest();

            await mockService.InitialiseAsync();

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

            mockService.StartTest();

            await mockService.DisposeAsync();

            Assert.True(mockService.DisposeServiceAsyncCalled);
        }
コード例 #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);
        }