示例#1
0
        public void DotnetOnPathTest()
        {
            Assert.True(_msiMgr.IsInstalled);

            _msiMgr.UnInstall();

            Assert.False(_msiMgr.IsInstalled);
            Assert.False(Utils.ExistsOnPath("dotnet.exe"), "After uninstallation dotnet tools must not be on path");
        }
        public void InstallTest()
        {
            string expectedInstallLocation = Environment.ExpandEnvironmentVariables(@"%ProgramFiles%\dotnet");

            // make sure that the msi is not already installed, if so the machine is in a bad state
            Assert.False(_msiMgr.IsInstalled, "The dotnet CLI msi is already installed");
            Assert.False(Directory.Exists(expectedInstallLocation));

            _msiMgr.Install();
            Assert.True(_msiMgr.IsInstalled);
            Assert.True(Directory.Exists(expectedInstallLocation));

            _msiMgr.UnInstall();
            Assert.False(_msiMgr.IsInstalled);
            Assert.False(Directory.Exists(expectedInstallLocation));
        }
示例#3
0
        public void Dispose()
        {
            if (!_msiMgr.IsInstalled)
            {
                return;
            }

            _msiMgr.UnInstall();
            Assert.False(_msiMgr.IsInstalled, "Unable to cleanup by uninstalling dotnet");
        }