mirror of https://github.com/dahall/Vanara.git
Tests for FhSVcCtl now working
parent
2251e5d7b1
commit
b8793f4af1
|
@ -1,6 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AssemblyName>UnitTest.PInvoke.FhSvcCtl</AssemblyName>
|
<AssemblyName>UnitTest.PInvoke.FhSvcCtl</AssemblyName>
|
||||||
|
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\..\PInvoke\FhSvcCtl\Vanara.PInvoke.FhSvcCtl.csproj" />
|
<ProjectReference Include="..\..\..\PInvoke\FhSvcCtl\Vanara.PInvoke.FhSvcCtl.csproj" />
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using NUnit.Framework.Internal;
|
using NUnit.Framework.Internal;
|
||||||
using System;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using static Vanara.PInvoke.FhSvcCtl;
|
using static Vanara.PInvoke.FhSvcCtl;
|
||||||
|
|
||||||
namespace Vanara.PInvoke.Tests
|
namespace Vanara.PInvoke.Tests
|
||||||
|
@ -9,23 +7,6 @@ namespace Vanara.PInvoke.Tests
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class FhSvcCtlTests
|
public class FhSvcCtlTests
|
||||||
{
|
{
|
||||||
[OneTimeSetUp]
|
|
||||||
public void _Setup()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[DllImport(Lib.Kernel32, CharSet = CharSet.Auto, SetLastError = true, BestFitMapping = false, ThrowOnUnmappableChar = true)]
|
|
||||||
static extern HINSTANCE LoadLibraryEx(string lpFileName, [Optional] IntPtr hFile, uint dwFlags);
|
|
||||||
|
|
||||||
[DllImport(Lib.Kernel32, SetLastError = true, ExactSpelling = true)]
|
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
|
||||||
static extern bool FreeLibrary(HINSTANCE hModule);
|
|
||||||
|
|
||||||
[OneTimeTearDown]
|
|
||||||
public void _TearDown()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestIntf()
|
public void TestIntf()
|
||||||
{
|
{
|
||||||
|
@ -36,10 +17,6 @@ namespace Vanara.PInvoke.Tests
|
||||||
[Test]
|
[Test]
|
||||||
public void TestFn()
|
public void TestFn()
|
||||||
{
|
{
|
||||||
HINSTANCE hi;
|
|
||||||
Assert.That(hi = LoadLibraryEx(@"C:\Windows\System32\fhsvccfg.dll", default, 0x1000), ResultIs.ValidHandle);
|
|
||||||
FreeLibrary(hi);
|
|
||||||
|
|
||||||
Assert.That(FhServiceOpenPipe(true, out var hPipe), ResultIs.Successful);
|
Assert.That(FhServiceOpenPipe(true, out var hPipe), ResultIs.Successful);
|
||||||
Assert.That(FhServiceReloadConfiguration(hPipe), ResultIs.Successful);
|
Assert.That(FhServiceReloadConfiguration(hPipe), ResultIs.Successful);
|
||||||
Assert.That(FhServiceStartBackup(hPipe, true), ResultIs.Successful);
|
Assert.That(FhServiceStartBackup(hPipe, true), ResultIs.Successful);
|
||||||
|
|
Loading…
Reference in New Issue