public void TestSetSelectedVersion() { _objectUnderTest = new TemplateChooserViewModel(_closeWindowMock.Object, _promptPickProjectMock.Object); _objectUnderTest.SelectedVersion = AspNetVersion.AspNetCore11; Assert.AreEqual(AspNetVersion.AspNetCore11, _objectUnderTest.SelectedVersion); }
public void BeforeEach() { _targetSdkVersions = new List <string>(); VsVersionUtils.s_toolsPathProvider = new Lazy <IToolsPathProvider>( () => Mock.Of <IToolsPathProvider>(tpp => tpp.GetNetCoreSdkVersions() == _targetSdkVersions)); CredentialsStore.Default.UpdateCurrentProject(Mock.Of <Project>(p => p.ProjectId == DefaultProjectId)); _closeWindowMock = new Mock <Action>(); _promptPickProjectMock = new Mock <Func <Project> >(); GoogleCloudExtensionPackageTests.InitPackageMock( dteMock => dteMock.Setup(dte => dte.Version).Returns(VsVersionUtils.VisualStudio2017Version)); _objectUnderTest = new TemplateChooserViewModel(_closeWindowMock.Object, _promptPickProjectMock.Object); }
public void TestInitialConditionsVs2015NoNetCoreSdk() { GoogleCloudExtensionPackageTests.InitPackageMock( dteMock => dteMock.Setup(dte => dte.Version).Returns(VsVersionUtils.VisualStudio2015Version)); _objectUnderTest = new TemplateChooserViewModel(_closeWindowMock.Object, _promptPickProjectMock.Object); Assert.IsFalse(_objectUnderTest.NetCoreAvailable); Assert.AreEqual(FrameworkType.NetFramework, _objectUnderTest.SelectedFramework); CollectionAssert.AreEqual( new[] { AspNetVersion.AspNet4 }, _objectUnderTest.AvailableVersions.ToList()); Assert.AreEqual(AspNetVersion.AspNet4, _objectUnderTest.SelectedVersion); }
public void TestInitialConditionsVs2017WithBothNetCoreSdk10And20() { GoogleCloudExtensionPackageTests.InitPackageMock( dteMock => dteMock.Setup(dte => dte.Version).Returns(VsVersionUtils.VisualStudio2017Version)); _targetSdkVersions.Add("2.0.0"); _targetSdkVersions.Add("1.0.0"); _objectUnderTest = new TemplateChooserViewModel(_closeWindowMock.Object, _promptPickProjectMock.Object); Assert.IsTrue(_objectUnderTest.NetCoreAvailable); Assert.AreEqual(FrameworkType.NetCore, _objectUnderTest.SelectedFramework); CollectionAssert.AreEqual( new[] { AspNetVersion.AspNetCore10, AspNetVersion.AspNetCore11, AspNetVersion.AspNetCore20 }, _objectUnderTest.AvailableVersions.ToList()); Assert.AreEqual(AspNetVersion.AspNetCore10, _objectUnderTest.SelectedVersion); }
public void TestSetSelectedFrameworkKeepSelectedVersion() { _targetSdkVersions.Add("2.0.0"); _targetSdkVersions.Add("1.0.0"); _objectUnderTest = new TemplateChooserViewModel(_closeWindowMock.Object, _promptPickProjectMock.Object); _objectUnderTest.SelectedVersion = AspNetVersion.AspNetCore11; _objectUnderTest.SelectedFramework = FrameworkType.NetCore; Assert.AreEqual(FrameworkType.NetCore, _objectUnderTest.SelectedFramework); CollectionAssert.AreEqual( new[] { AspNetVersion.AspNetCore10, AspNetVersion.AspNetCore11, AspNetVersion.AspNetCore20 }, _objectUnderTest.AvailableVersions.ToList()); Assert.AreEqual(AspNetVersion.AspNetCore11, _objectUnderTest.SelectedVersion); }