mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Remove Commands.Omi module
This was a temporary work-around that now needs to be removed (mostly because the xUnit tests are out-of-date because we didn't have a runner, and it's not worth it to fix them). Rather than let more cruft accumulate, we need to remove it. Resolves #551
This commit is contained in:
1 parent
eb43300842
commit
c68164f280
12 files changed
-834
No files matched your search
@@ -1,71 +0,0 @@
|
||||
using Xunit;
|
||||
using System;
|
||||
using System.Management.Automation;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace PSTests
|
||||
{
|
||||
public static class OmiInterfaceTests
|
||||
{
|
||||
[Fact]
|
||||
public static void TestHostName()
|
||||
{
|
||||
const string ns = "root/omi";
|
||||
const string cn = "OMI_Identify";
|
||||
const string property = "SystemName";
|
||||
|
||||
string expected = null;
|
||||
|
||||
var startInfo = new ProcessStartInfo
|
||||
{
|
||||
FileName = @"/usr/bin/env",
|
||||
Arguments = "hostname",
|
||||
RedirectStandardOutput = true,
|
||||
UseShellExecute = false
|
||||
};
|
||||
using (Process process = Process.Start(startInfo))
|
||||
{
|
||||
// Get output of call to hostname without trailing newline
|
||||
expected = process.StandardOutput.ReadToEnd().Trim();
|
||||
process.WaitForExit();
|
||||
|
||||
// The process should return an exit code of 0 on success
|
||||
Assert.Equal(0, process.ExitCode);
|
||||
}
|
||||
|
||||
string value = null;
|
||||
OmiInterface oi = new OmiInterface();
|
||||
oi.GetOmiValue(ns, cn, property, out value);
|
||||
Assert.Equal(expected, value);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void TestXHugeNumberEnumerable()
|
||||
{
|
||||
const string ns = "interop";
|
||||
const string cn = "X_HugeNumber";
|
||||
|
||||
OmiInterface oi = new OmiInterface();
|
||||
IEnumerable<XElement> elements;
|
||||
oi.GetOmiValues(ns, cn, out elements);
|
||||
Assert.True(elements.FirstOrDefault() != null);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public static void TestXHugeNumberOmiData()
|
||||
{
|
||||
const string ns = "interop";
|
||||
const string cn = "X_HugeNumber";
|
||||
|
||||
OmiInterface oi = new OmiInterface();
|
||||
|
||||
OmiData data;
|
||||
oi.GetOmiValues(ns, cn, out data);
|
||||
Assert.True(data != null);
|
||||
Assert.Equal(data.Values.Count(), 22);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user