SystemInformationTests ClassDelta Engine Documentation
Inheritance Hierarchy

System Object
  DeltaEngine.Platforms TestWithMocksOrVisually
    DeltaEngine.Platforms.Tests SystemInformationTests

Namespace: DeltaEngine.Platforms.Tests
Assembly: DeltaEngine.Platforms.Tests (in DeltaEngine.Platforms.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public class SystemInformationTests : TestWithMocksOrVisually

The SystemInformationTests type exposes the following members.

Constructors

  NameDescription
Public methodSystemInformationTests
Initializes a new instance of the SystemInformationTests class
Top
Methods

  NameDescription
Protected methodAdvanceTimeAndUpdateEntities (Inherited from TestWithMocksOrVisually.)
Public methodCheckHasNetworkState
Public methodCheckMachineNameMatchesEnvironment
Public methodCheckPlatformNameIsWindows
Public methodCheckPlatformVersionMatchesEnvironment
Public methodCheckVersionIsCorrect
Public methodHasAvailableRam
Public methodHasCpuName
Public methodHasCpuSpeed
Public methodHasCpuUsage
Public methodHasGpuName
Public methodHasLanguage
Public methodHasMaxRam
Public methodHasUsedRam
Public methodInitializeResolver (Inherited from TestWithMocksOrVisually.)
Public methodIsSoundCardAvailableDoesNotThrowException
Protected methodRegisterMock T  (Inherited from TestWithMocksOrVisually.)
Protected methodResolve T  (Inherited from TestWithMocksOrVisually.)
Protected methodRunAfterFirstFrame (Inherited from TestWithMocksOrVisually.)
Public methodRunTestAndDisposeResolverWhenDone (Inherited from TestWithMocksOrVisually.)
Public methodSystemInfoSetup
Public methodVerifyCoreCountMatchesEnvironment
Public methodVerifyDeviceType
Public methodVerifyMaxResolution
Public methodVerifyUsernameMatchesEnvironment
Top
Properties

  NameDescription
Protected propertyIsMockResolver (Inherited from TestWithMocksOrVisually.)
Top
Examples

[Test]
public void HasLanguage()
{
    Assert.IsFalse(string.IsNullOrEmpty(info.Language));
}
[Test]
public void CheckVersionIsCorrect()
{
    Assert.GreaterOrEqual(info.Version, new Version("0.9.8.3"));
}
[Test]
public void CheckHasNetworkState()
{
    Assert.IsTrue(info.NetworkState == NetworkState.ConnectedViaWifiNetwork ||
        info.NetworkState == NetworkState.Disconnected);
}
[Test]
public void CheckMachineNameMatchesEnvironment()
{
    Assert.IsTrue(info.MachineName == Environment.MachineName ||
        info.MachineName == "MockMachineName", info.MachineName);
}
[Test]
public void CheckPlatformNameIsWindows()
{
    Assert.IsTrue(info.PlatformName == "Windows", info.PlatformName);
}
[Test]
public void CheckPlatformVersionMatchesEnvironment()
{
    Assert.GreaterOrEqual(info.PlatformVersion, new Version(6, 0));
}
[Test]
public void VerifyDeviceType()
{
    Assert.IsFalse(info.IsMobileDevice);
    Assert.IsFalse(info.IsTablet);
    Assert.IsFalse(info.IsConsole);
}
[Test]
public void VerifyMaxResolution()
{
    var size = new Size(System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Width,
        System.Windows.Forms.SystemInformation.PrimaryMonitorSize.Height);
    Assert.IsTrue(info.MaxResolution == size || info.MaxResolution == new Size(1920, 1080));
}
[Test]
public void VerifyUsernameMatchesEnvironment()
{
    Assert.IsTrue(info.Username == Environment.UserName || info.Username == "MockUsername");
}
[Test]
public void HasCpuName()
{
    Assert.GreaterOrEqual(info.CoreCount, 1);
    Assert.IsFalse(string.IsNullOrEmpty(info.CpuName));
}
[Test]
public void HasGpuName()
{
    Assert.IsFalse(string.IsNullOrEmpty(info.GpuName));
}
[Test]
public void HasCpuSpeed()
{
    Assert.IsTrue(info.CpuSpeed > 0.0f);
}
[Test]
public void HasCpuUsage()
{
    Assert.IsTrue(info.CpuUsage.Length > 0);
}
[Test]
public void VerifyCoreCountMatchesEnvironment()
{
    Assert.IsTrue(info.Username == Environment.UserName || info.Username == "MockUsername");
}
[Test]
public void HasMaxRam()
{
    Assert.IsTrue(info.MaxRam > 0.0f);
}
[Test]
public void HasUsedRam()
{
    Assert.IsTrue(info.UsedRam > 0.0f);
}
[Test]
public void HasAvailableRam()
{
    Assert.IsTrue(info.AvailableRam > 0.0f);
}
[Test]
public void IsSoundCardAvailableDoesNotThrowException()
{
    Assert.AreEqual(info.SoundCardAvailable, info.SoundCardAvailable);
}
See Also