/// <summary> /// <para>Returns the current System status</para> /// </summary> /// <returns></returns> public static TreeNode GetStatus() { TreeNode tnMain = new TreeNode("System"); tnMain.Nodes.Add("Windows version: " + WindowsVersion.ToString()); tnMain.Nodes.Add("Is 64bit OS: " + Is64BitOS.ToString()); tnMain.Nodes.Add("Fonts installed: " + InstalledFonts.Count); tnMain.Nodes.Add("User name: " + UserName); tnMain.Nodes.Add("User domain name: " + UserDomainName); return(tnMain); }
private void AboutWindowSourceInitialized(object sender, EventArgs e) { System.Reflection.AssemblyName name = System.Reflection.Assembly.GetExecutingAssembly().GetName(); string architecture = name.ProcessorArchitecture.ToString(); string a = null; switch (architecture) { case "Amd64": a = "64"; break; case "X86": a = "32"; break; } TextBlock1.Text = app.Language.Version + ": " + name.Version.ToString() + Environment.NewLine + app.Language.Type + ": " + a + " " + app.Language.BitWidthApplication; // TextBlock2.Text = app.Language.Runtime + ":" + Environment.NewLine + "Common Language Runtime " + Environment.Version.ToString(2) + Environment.NewLine + Environment.NewLine + app.Language.OS + ":" + Environment.NewLine + WindowsVersion.ToString(); }
public void Provider_Should_Create_Windows_VirtualMachine_Infrastructure_Json_File() { //Arrang int cpu = 8; int ram = 4; int hdd = 40; WindowsVersion windowsVersion = WindowsVersion.WindowsServer2012; var expectedObject = new VirtualMachineResource { CPU = cpu, HardDisk = hdd, RAM = ram, OperatingSystem = windowsVersion.ToString() }; var fileSystemMock = new Mock <IFileManager>(); fileSystemMock.Setup(w => w.WriteJsonFile(It.IsAny <object>(), It.IsAny <string>(), It.IsAny <string>())) .Verifiable(); //Act var provider = new Providers.Provider(_providerName, fileSystemMock.Object); var infra = provider.CreateInfrastructure("UAT"); infra.VirtualMachine(new Windows(windowsVersion), hdd, ram, cpu); //Assert fileSystemMock.Verify(mock => mock.WriteJsonFile(It.IsAny <object>(), It.IsAny <string>(), It.IsAny <string>()), Times.Once()); fileSystemMock.Verify(mock => mock.WriteJsonFile(expectedObject, @"c:\test\UAT\VirtualMachine", "UAT_Server.json"), Times.Once()); }
public override string Build() { return(_version.ToString()); }
public InvalidWindowsTargetException ( WindowsVersion ExpectedVersion, WindowsVersion FoundVersion ) : base ( "Wrong Windows platform (\"" + FoundVersion. ToString ( ) + "\") ; Expected version is : " + ExpectedVersion. ToString ( ) + "." ) { }