diff options
Diffstat (limited to 'src/api/burn/test/BextUtilUnitTest')
5 files changed, 66 insertions, 3 deletions
diff --git a/src/api/burn/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj b/src/api/burn/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj index b24d1fad..c27fb442 100644 --- a/src/api/burn/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj +++ b/src/api/burn/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj | |||
@@ -36,6 +36,7 @@ | |||
36 | </PropertyGroup> | 36 | </PropertyGroup> |
37 | 37 | ||
38 | <ItemGroup> | 38 | <ItemGroup> |
39 | <ClCompile Include="BundleExtensionTests.cpp" /> | ||
39 | <ClCompile Include="precomp.cpp"> | 40 | <ClCompile Include="precomp.cpp"> |
40 | <PrecompiledHeader>Create</PrecompiledHeader> | 41 | <PrecompiledHeader>Create</PrecompiledHeader> |
41 | <!-- Warnings from referencing netstandard dlls --> | 42 | <!-- Warnings from referencing netstandard dlls --> |
@@ -46,6 +47,7 @@ | |||
46 | 47 | ||
47 | <ItemGroup> | 48 | <ItemGroup> |
48 | <ClInclude Include="precomp.h" /> | 49 | <ClInclude Include="precomp.h" /> |
50 | <ClInclude Include="TestBundleExtension.h" /> | ||
49 | </ItemGroup> | 51 | </ItemGroup> |
50 | 52 | ||
51 | <ItemGroup> | 53 | <ItemGroup> |
diff --git a/src/api/burn/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj.filters b/src/api/burn/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj.filters index f1711f81..73f2194d 100644 --- a/src/api/burn/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj.filters +++ b/src/api/burn/test/BextUtilUnitTest/BextUtilUnitTest.vcxproj.filters | |||
@@ -15,6 +15,9 @@ | |||
15 | </Filter> | 15 | </Filter> |
16 | </ItemGroup> | 16 | </ItemGroup> |
17 | <ItemGroup> | 17 | <ItemGroup> |
18 | <ClCompile Include="BundleExtensionTests.cpp"> | ||
19 | <Filter>Source Files</Filter> | ||
20 | </ClCompile> | ||
18 | <ClCompile Include="precomp.cpp"> | 21 | <ClCompile Include="precomp.cpp"> |
19 | <Filter>Source Files</Filter> | 22 | <Filter>Source Files</Filter> |
20 | </ClCompile> | 23 | </ClCompile> |
@@ -26,5 +29,8 @@ | |||
26 | <ClInclude Include="precomp.h"> | 29 | <ClInclude Include="precomp.h"> |
27 | <Filter>Header Files</Filter> | 30 | <Filter>Header Files</Filter> |
28 | </ClInclude> | 31 | </ClInclude> |
32 | <ClInclude Include="TestBundleExtension.h"> | ||
33 | <Filter>Header Files</Filter> | ||
34 | </ClInclude> | ||
29 | </ItemGroup> | 35 | </ItemGroup> |
30 | </Project> \ No newline at end of file | 36 | </Project> \ No newline at end of file |
diff --git a/src/api/burn/test/BextUtilUnitTest/BundleExtensionTests.cpp b/src/api/burn/test/BextUtilUnitTest/BundleExtensionTests.cpp new file mode 100644 index 00000000..fde9d2b6 --- /dev/null +++ b/src/api/burn/test/BextUtilUnitTest/BundleExtensionTests.cpp | |||
@@ -0,0 +1,44 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | #include "precomp.h" | ||
4 | |||
5 | using namespace System; | ||
6 | using namespace Xunit; | ||
7 | using namespace WixBuildTools::TestSupport; | ||
8 | using namespace WixBuildTools::TestSupport::XunitExtensions; | ||
9 | |||
10 | namespace BextUtilTests | ||
11 | { | ||
12 | public ref class BundleExtension | ||
13 | { | ||
14 | public: | ||
15 | [Fact] | ||
16 | void CanCreateTestBundleExtension() | ||
17 | { | ||
18 | HRESULT hr = S_OK; | ||
19 | BUNDLE_EXTENSION_CREATE_ARGS args = { }; | ||
20 | BUNDLE_EXTENSION_CREATE_RESULTS results = { }; | ||
21 | IBundleExtensionEngine* pEngine = NULL; | ||
22 | IBundleExtension* pBundleExtension = NULL; | ||
23 | |||
24 | args.cbSize = sizeof(args); | ||
25 | args.wzBundleExtensionDataPath = L"test.xml"; | ||
26 | |||
27 | results.cbSize = sizeof(results); | ||
28 | |||
29 | try | ||
30 | { | ||
31 | hr = BextInitializeFromCreateArgs(&args, &pEngine); | ||
32 | NativeAssert::Succeeded(hr, "Failed to create engine."); | ||
33 | |||
34 | hr = TestBundleExtensionCreate(pEngine, &args, &results, &pBundleExtension); | ||
35 | NativeAssert::Succeeded(hr, "Failed to create BootstrapperApplication."); | ||
36 | } | ||
37 | finally | ||
38 | { | ||
39 | ReleaseObject(pEngine); | ||
40 | ReleaseObject(pBundleExtension); | ||
41 | } | ||
42 | } | ||
43 | }; | ||
44 | } | ||
diff --git a/src/api/burn/test/BextUtilUnitTest/TestBundleExtension.h b/src/api/burn/test/BextUtilUnitTest/TestBundleExtension.h new file mode 100644 index 00000000..5cfe8b39 --- /dev/null +++ b/src/api/burn/test/BextUtilUnitTest/TestBundleExtension.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #pragma once | ||
2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
3 | |||
4 | HRESULT TestBundleExtensionCreate( | ||
5 | __in IBundleExtensionEngine* pEngine, | ||
6 | __in const BUNDLE_EXTENSION_CREATE_ARGS* pArgs, | ||
7 | __inout BUNDLE_EXTENSION_CREATE_RESULTS* pResults, | ||
8 | __out IBundleExtension** ppBundleExtension | ||
9 | ); | ||
diff --git a/src/api/burn/test/BextUtilUnitTest/precomp.h b/src/api/burn/test/BextUtilUnitTest/precomp.h index a6586f70..cf5256b8 100644 --- a/src/api/burn/test/BextUtilUnitTest/precomp.h +++ b/src/api/burn/test/BextUtilUnitTest/precomp.h | |||
@@ -11,9 +11,11 @@ | |||
11 | #include <BundleExtensionEngine.h> | 11 | #include <BundleExtensionEngine.h> |
12 | #include <BundleExtension.h> | 12 | #include <BundleExtension.h> |
13 | 13 | ||
14 | #include "IBundleExtensionEngine.h" | 14 | #include <IBundleExtensionEngine.h> |
15 | #include "IBundleExtension.h" | 15 | #include <IBundleExtension.h> |
16 | #include "bextutil.h" | 16 | #include <bextutil.h> |
17 | |||
18 | #include "TestBundleExtension.h" | ||
17 | 19 | ||
18 | #pragma managed | 20 | #pragma managed |
19 | #include <vcclr.h> | 21 | #include <vcclr.h> |