コード例 #1
0
        // ReSharper disable once TooManyDependencies
        public DropBoxHelper(DropBoxViewWindow dropBoxViewWindow, IEnvironmentModel activeEnvironment, string resourceType, string resourcePath)
        {
            VerifyArgument.AreNotNull(new Dictionary<string, object>{{"dropBoxViewWindow",dropBoxViewWindow},{"activeEnvironment",activeEnvironment},{"resourceType",resourceType},{"resourcePath",resourcePath}});
            ActiveEnvironment = activeEnvironment;
            ResourceType = resourceType;
            ResourcePath = resourcePath;
            DropBoxViewWindow = dropBoxViewWindow;

        }
コード例 #2
0
 // ReSharper disable once TooManyDependencies
 public DropBoxHelper(DropBoxViewWindow dropBoxViewWindow, IEnvironmentModel activeEnvironment, string resourceType, string resourcePath)
 {
     VerifyArgument.AreNotNull(new Dictionary <string, object> {
         { "dropBoxViewWindow", dropBoxViewWindow }, { "activeEnvironment", activeEnvironment }, { "resourceType", resourceType }, { "resourcePath", resourcePath }
     });
     ActiveEnvironment = activeEnvironment;
     ResourceType      = resourceType;
     ResourcePath      = resourcePath;
     DropBoxViewWindow = dropBoxViewWindow;
 }
コード例 #3
0
        public async Task DropBoxSourceViewModel_LoadBrowserUri_HasInternetConnection_Navigates()
        {
            //------------Setup for test--------------------------
            const string uri = "http://community.warewolf.io/";
            var networkHelper = new Mock<INetworkHelper>();
            var dropFactory = new Mock<IDropboxFactory>();
            dropFactory.Setup(a => a.Create()).Returns(new Mock<IDropNetClient>().Object);
            var task = new Task<bool>(() => true);
            task.RunSynchronously();
            networkHelper.Setup(m => m.HasConnectionAsync(It.IsAny<string>()))
                .Returns(task);
            var helpViewWrapper = new Mock<IDropBoxHelper>();
            helpViewWrapper.Setup(m => m.Navigate(It.IsAny<string>())).Verifiable();
            helpViewWrapper.Setup(a => a.WebBrowser).Returns(new WebBrowser());
            var helpViewModel = new DropBoxSourceViewModel(networkHelper.Object, helpViewWrapper.Object, dropFactory.Object,false);
            var helpView = new DropBoxViewWindow();
            helpViewWrapper.SetupGet(m => m.DropBoxViewWindow).Returns(helpView);
            //------------Execute Test---------------------------
            await helpViewModel.LoadBrowserUri(uri);
            //------------Assert Results-------------------------
            helpViewWrapper.Verify(m => m.Navigate(It.IsAny<string>()), Times.AtLeastOnce());

        }
コード例 #4
0
        public DropBoxHelper(DropBoxViewWindow dropBoxViewWindow)
        {
            VerifyArgument.IsNotNull("dropBoxViewWindow",dropBoxViewWindow);
            DropBoxViewWindow = dropBoxViewWindow;

        }
コード例 #5
0
 public void CloseAndSave(DropBoxSourceViewModel dropBoxSourceViewModel)
 {
     DropBoxViewWindow.DialogResult = true;
     DropBoxViewWindow.Close();
 }
コード例 #6
0
 public DropBoxHelper(DropBoxViewWindow dropBoxViewWindow)
 {
     VerifyArgument.IsNotNull("dropBoxViewWindow", dropBoxViewWindow);
     DropBoxViewWindow = dropBoxViewWindow;
 }
コード例 #7
0
        public void DropboxHelper_Ctor_PropertiesSet()
        {
            var env = new Mock<IEnvironmentModel>().Object;
            var win = new DropBoxViewWindow();
            //------------Setup for test--------------------------
            var dropboxHelper = new DropBoxHelper(win, env, "a", "b");

            //------------Execute Test---------------------------
            Assert.AreEqual(dropboxHelper.ActiveEnvironment,env);
            Assert.AreEqual(dropboxHelper.DropBoxViewWindow,win);
            Assert.AreEqual(dropboxHelper.ResourcePath,"b");
            Assert.AreEqual(dropboxHelper.ResourceType, "a");
            Assert.AreEqual(dropboxHelper.CircularProgressBar,win.CircularProgressBar);
            Assert.AreEqual(dropboxHelper.WebBrowser,win.WebBrowserHost);
            //------------Assert Results-------------------------
        }