public GatherSystemInformationTO(enTypeOfSystemInformationToGather enTypeOfSystemInformation, string result, int indexNumber, bool inserted = false) { Inserted = inserted; EnTypeOfSystemInformation = enTypeOfSystemInformation; Result = result; IndexNumber = indexNumber; }
public string GetCorrectSystemInformation(enTypeOfSystemInformationToGather enTypeOfSystemInformation) { switch (enTypeOfSystemInformation) { case enTypeOfSystemInformationToGather.OperatingSystem: return(GetSystemInformation.GetOperatingSystemInformation()); case enTypeOfSystemInformationToGather.ServicePack: return(GetSystemInformation.GetServicePackInformation()); case enTypeOfSystemInformationToGather.OSBitValue: return(GetSystemInformation.GetOSBitValueInformation()); case enTypeOfSystemInformationToGather.FullDateTime: return(GetSystemInformation.GetFullDateTimeInformation()); case enTypeOfSystemInformationToGather.DateTimeFormat: return(GetSystemInformation.GetDateTimeFormatInformation()); case enTypeOfSystemInformationToGather.DiskAvailable: return(GetSystemInformation.GetDiskSpaceAvailableInformation()); case enTypeOfSystemInformationToGather.DiskTotal: return(GetSystemInformation.GetDiskSpaceTotalInformation()); case enTypeOfSystemInformationToGather.PhysicalMemoryAvailable: return(GetSystemInformation.GetPhysicalMemoryAvailableInformation()); case enTypeOfSystemInformationToGather.PhysicalMemoryTotal: return(GetSystemInformation.GetPhysicalMemoryTotalInformation()); case enTypeOfSystemInformationToGather.CPUAvailable: return(GetSystemInformation.GetCPUAvailableInformation()); case enTypeOfSystemInformationToGather.CPUTotal: return(GetSystemInformation.GetCPUTotalInformation()); case enTypeOfSystemInformationToGather.Language: return(GetSystemInformation.GetLanguageInformation()); case enTypeOfSystemInformationToGather.Region: return(GetSystemInformation.GetRegionInformation()); case enTypeOfSystemInformationToGather.UserRoles: return(GetSystemInformation.GetUserRolesInformation(_currentIdentity)); case enTypeOfSystemInformationToGather.UserName: return(GetSystemInformation.GetUserNameInformation()); case enTypeOfSystemInformationToGather.Domain: return(GetSystemInformation.GetDomainInformation()); case enTypeOfSystemInformationToGather.NumberOfWarewolfAgents: return(GetSystemInformation.GetNumberOfWareWolfAgentsInformation()); default: throw new ArgumentOutOfRangeException("enTypeOfSystemInformation"); } }
public GatherSystemInformationTO(enTypeOfSystemInformationToGather enTypeOfSystemInformation, string result, int indexNumber, bool inserted = false) { Inserted = inserted; EnTypeOfSystemInformation = enTypeOfSystemInformation; Result = result; IndexNumber = indexNumber; }
public void ConstructorWhereParametersExpectSetsProperties() { //------------Setup for test-------------------------- const string ResultVariable = "[[Output]]"; const enTypeOfSystemInformationToGather TOGather = enTypeOfSystemInformationToGather.OperatingSystem; const int IndexNumber = 0; //------------Execute Test--------------------------- var gatherSystemInformationTO = new GatherSystemInformationTO(TOGather, ResultVariable, IndexNumber); //------------Assert Results------------------------- Assert.IsNotNull(gatherSystemInformationTO); Assert.AreEqual(ResultVariable, gatherSystemInformationTO.Result); Assert.AreEqual(TOGather, gatherSystemInformationTO.EnTypeOfSystemInformation); Assert.AreEqual(IndexNumber, gatherSystemInformationTO.IndexNumber); }
public void GivenItContainsGatherSystemInfoAs(string parentName, string activityName, Table table) { var activity = new DsfGatherSystemInformationActivity { DisplayName = activityName }; foreach (var tableRow in table.Rows) { var variable = tableRow["Variable"]; CommonSteps.AddVariableToVariableList(variable); enTypeOfSystemInformationToGather systemInfo = (enTypeOfSystemInformationToGather)Dev2EnumConverter.GetEnumFromStringDiscription(tableRow["Selected"], typeof(enTypeOfSystemInformationToGather)); activity.SystemInformationCollection.Add(new GatherSystemInformationTO(systemInfo, variable, 1)); } CommonSteps.AddActivityToActivityList(parentName, activityName, activity); }
private void AddToCollection(IEnumerable <string> listToAdd, ModelItem modelItem) { var modelProperty = modelItem.Properties["SystemInformationCollection"]; if (modelProperty != null) { ModelItemCollection mic = modelProperty.Collection; if (mic != null) { int startIndex = 0; const enTypeOfSystemInformationToGather EnTypeOfSystemInformation = enTypeOfSystemInformationToGather.FullDateTime; mic.Clear(); foreach (string s in listToAdd) { mic.Add(new GatherSystemInformationTO(EnTypeOfSystemInformation, s, startIndex + 1)); startIndex++; } CleanUpCollection(mic, modelItem, startIndex); } } }
#pragma warning disable S1541 // Methods and properties should not be too complex public string GetCorrectSystemInformation(enTypeOfSystemInformationToGather enTypeOfSystemInformation) #pragma warning restore S1541 // Methods and properties should not be too complex { switch (enTypeOfSystemInformation) { case enTypeOfSystemInformationToGather.ComputerName: return(GetSystemInformation.GetComputerName()); case enTypeOfSystemInformationToGather.OperatingSystem: return(GetSystemInformation.GetOperatingSystemInformation()); case enTypeOfSystemInformationToGather.OperatingSystemVersion: return(GetSystemInformation.GetOperatingSystemVersionInformation()); case enTypeOfSystemInformationToGather.ServicePack: return(GetSystemInformation.GetServicePackInformation()); case enTypeOfSystemInformationToGather.OSBitValue: return(GetSystemInformation.GetOSBitValueInformation()); case enTypeOfSystemInformationToGather.FullDateTime: return(GetSystemInformation.GetFullDateTimeInformation()); case enTypeOfSystemInformationToGather.DateTimeFormat: return(GetSystemInformation.GetDateTimeFormatInformation()); case enTypeOfSystemInformationToGather.DiskAvailable: return(GetSystemInformation.GetDiskSpaceAvailableInformation()); case enTypeOfSystemInformationToGather.DiskTotal: return(GetSystemInformation.GetDiskSpaceTotalInformation()); case enTypeOfSystemInformationToGather.VirtualMemoryAvailable: return(GetSystemInformation.GetVirtualMemoryAvailableInformation()); case enTypeOfSystemInformationToGather.VirtualMemoryTotal: return(GetSystemInformation.GetVirtualMemoryTotalInformation()); case enTypeOfSystemInformationToGather.PhysicalMemoryAvailable: return(GetSystemInformation.GetPhysicalMemoryAvailableInformation()); case enTypeOfSystemInformationToGather.PhysicalMemoryTotal: return(GetSystemInformation.GetPhysicalMemoryTotalInformation()); case enTypeOfSystemInformationToGather.CPUAvailable: return(GetSystemInformation.GetCPUAvailableInformation()); case enTypeOfSystemInformationToGather.CPUTotal: return(GetSystemInformation.GetCPUTotalInformation()); case enTypeOfSystemInformationToGather.Language: return(GetSystemInformation.GetLanguageInformation()); case enTypeOfSystemInformationToGather.Region: return(GetSystemInformation.GetRegionInformation()); case enTypeOfSystemInformationToGather.UserRoles: return(GetSystemInformation.GetUserRolesInformation(_currentIdentity)); case enTypeOfSystemInformationToGather.UserName: return(GetSystemInformation.GetUserNameInformation()); case enTypeOfSystemInformationToGather.Domain: return(GetSystemInformation.GetDomainInformation()); case enTypeOfSystemInformationToGather.NumberOfServerNICS: return(GetSystemInformation.GetNumberOfNICS()); case enTypeOfSystemInformationToGather.MacAddress: return(GetSystemInformation.GetMACAdresses()); case enTypeOfSystemInformationToGather.GateWayAddress: return(GetSystemInformation.GetDefaultGateway()); case enTypeOfSystemInformationToGather.DNSAddress: return(GetSystemInformation.GetDNSServer()); case enTypeOfSystemInformationToGather.IPv4Address: return(GetSystemInformation.GetIPv4Adresses()); case enTypeOfSystemInformationToGather.IPv6Address: return(GetSystemInformation.GetIPv6Adresses()); case enTypeOfSystemInformationToGather.WarewolfMemory: return(GetSystemInformation.GetWarewolfServerMemory()); case enTypeOfSystemInformationToGather.WarewolfCPU: return(GetSystemInformation.GetWarewolfCPU()); case enTypeOfSystemInformationToGather.WarewolfServerVersion: return(GetSystemInformation.GetWareWolfVersion()); default: throw new ArgumentOutOfRangeException("enTypeOfSystemInformation"); } }
public GatherSystemInformationTO(enTypeOfSystemInformationToGather enTypeOfSystemInformation, string result, int indexNumber) : this(enTypeOfSystemInformation, result, indexNumber, false) { }