コード例 #1
0
        public void Setup()
        {
            this.authenticationProvider = new MockAuthenticationProvider();
            this.serializer             = new MockSerializer();

            this.httpResponseMessage = new HttpResponseMessage();
            this.httpProvider        = new MockHttpProvider(this.httpResponseMessage, this.serializer.Object);

            this.oneDriveClient = new Mock <IOneDriveClient>(MockBehavior.Strict);
            this.oneDriveClient.SetupAllProperties();
            this.oneDriveClient.SetupGet(client => client.AuthenticationProvider).Returns(this.authenticationProvider.Object);
            this.oneDriveClient.Setup(client => client.AuthenticateAsync()).Returns(Task.FromResult(new AccountSession()));
            this.oneDriveClient.SetupGet(client => client.HttpProvider).Returns(this.httpProvider.Object);

            this.progress = new MockProgress();

            this.asyncMonitor = new ItemCopyAsyncMonitor(this.oneDriveClient.Object, AsyncMonitorTests.monitorUrl);
        }
コード例 #2
0
        public void Setup()
        {
            this.authenticationProvider = new MockAuthenticationProvider();
            this.serializer = new MockSerializer();

            this.httpResponseMessage = new HttpResponseMessage();
            this.httpProvider = new MockHttpProvider(this.httpResponseMessage, this.serializer.Object);

            this.oneDriveClient = new Mock<IOneDriveClient>(MockBehavior.Strict);
            this.oneDriveClient.SetupAllProperties();
            this.oneDriveClient.SetupGet(client => client.AuthenticationProvider).Returns(this.authenticationProvider.Object);
            this.oneDriveClient.Setup(client => client.AuthenticateAsync()).Returns(Task.FromResult(new AccountSession()));
            this.oneDriveClient.SetupGet(client => client.HttpProvider).Returns(this.httpProvider.Object);

            this.progress = new MockProgress();
            
            this.asyncMonitor = new ItemCopyAsyncMonitor(this.oneDriveClient.Object, AsyncMonitorTests.monitorUrl);
        }