Skip to content

Commit 62095dc

Browse files
committed
(specs) integration SetUpFixture
1 parent 8f151d5 commit 62095dc

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// Copyright © 2011 - Present RealDimensions Software, LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
//
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
16+
namespace chocolatey.tests.integration
17+
{
18+
using System.Collections.Generic;
19+
using NUnit.Framework;
20+
using SimpleInjector;
21+
using chocolatey.infrastructure.app.builders;
22+
using chocolatey.infrastructure.app.configuration;
23+
using chocolatey.infrastructure.filesystem;
24+
using chocolatey.infrastructure.registration;
25+
using chocolatey.infrastructure.services;
26+
27+
// ReSharper disable InconsistentNaming
28+
29+
[SetUpFixture]
30+
public class NUnitSetup : tests.NUnitSetup
31+
{
32+
public override void BeforeEverything()
33+
{
34+
base.BeforeEverything();
35+
36+
Container = SimpleInjectorContainer.initialize();
37+
var config = Container.GetInstance<ChocolateyConfiguration>();
38+
39+
ConfigurationBuilder.set_up_configuration(new List<string>(), config, Container.GetInstance<IFileSystem>(), Container.GetInstance<IXmlService>(), null);
40+
}
41+
42+
public static Container Container { get; set; }
43+
}
44+
45+
46+
// ReSharper restore InconsistentNaming
47+
}

src/chocolatey.tests.integration/chocolatey.tests.integration.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
<Compile Include="infrastructure\filesystem\DotNetFileSystemSpecs.cs" />
7777
<Compile Include="MockEventSubscriptionManager.cs" />
7878
<Compile Include="Properties\AssemblyInfo.cs" />
79+
<Compile Include="NUnitSetup.cs" />
7980
<Compile Include="TODO.cs" />
8081
</ItemGroup>
8182
<ItemGroup>

0 commit comments

Comments
 (0)