public async Task TestPackageValues()
        {
            const string mockedVersion = "MockVsVersion";
            const string mockedEdition = "MockedEdition";

            DteMock.Setup(dte => dte.Version).Returns(mockedVersion);
            DteMock.Setup(dte => dte.Edition).Returns(mockedEdition);

            await RunPackageInitializeAsync();

            string expectedAssemblyVersion = GetVsixManifestVersion();

            Assert.AreEqual(mockedVersion, GoogleCloudExtensionPackage.Instance.VsVersion);
            Assert.AreEqual(mockedEdition, GoogleCloudExtensionPackage.Instance.VsEdition);
            Assert.AreEqual(ExpectedAssemblyName, GoogleCloudExtensionPackage.Instance.ApplicationName);
            Assert.AreEqual(expectedAssemblyVersion, GoogleCloudExtensionPackage.Instance.ApplicationVersion);
            Assert.AreEqual(
                $"{ExpectedAssemblyName}/{expectedAssemblyVersion}",
                GoogleCloudExtensionPackage.Instance.VersionedApplicationName);
            Assert.AreEqual(
                GoogleCloudExtensionPackage.Instance.ApplicationVersion,
                GoogleCloudExtensionPackage.Instance.GeneralSettings.InstalledVersion);
            Assert.IsNull(GoogleCloudExtensionPackage.Instance.GeneralSettings.ClientId);
            Assert.IsFalse(GoogleCloudExtensionPackage.Instance.GeneralSettings.DialogShown);
            Assert.IsFalse(GoogleCloudExtensionPackage.Instance.GeneralSettings.OptIn);
        }
Beispiel #2
0
        public async Task TestWindowActiveWhenNormalState()
        {
            DteMock.Setup(d => d.MainWindow).Returns(Mock.Of <Window>(w => w.WindowState == vsWindowState.vsWindowStateNormal));

            await RunPackageInitalizeAsync();

            Assert.IsTrue(_objectUnderTest.IsWindowActive());
        }
        public async Task TestWindowActiveWhenMinimizedState()
        {
            DteMock.Setup(d => d.MainWindow).Returns(Mock.Of <Window>(w => w.WindowState == vsWindowState.vsWindowStateMinimize));

            await RunPackageInitializeAsync();

            Assert.IsFalse(_objectUnderTest.IsWindowActive());
        }
        public void TestWindowActiveWhenMaximizedState()
        {
            DteMock.Setup(d => d.MainWindow).Returns(Mock.Of <Window>(w => w.WindowState == vsWindowState.vsWindowStateMaximize));

            RunPackageInitalize();

            Assert.IsTrue(_objectUnderTest.IsWindowActive());
        }