Compare commits
7 Commits
204c211603
...
main
Author | SHA1 | Date | |
---|---|---|---|
b02a68a62a | |||
e4ba50f337 | |||
45cc9dfce9 | |||
4dce511b57 | |||
90b7c99e08 | |||
22c6f5a109 | |||
02dbea83e7 |
47
.gitea/workflows/artifacts.yaml
Normal file
47
.gitea/workflows/artifacts.yaml
Normal file
@ -0,0 +1,47 @@
|
||||
on: [push]
|
||||
jobs:
|
||||
upload-many:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: mkdir -p artifacts
|
||||
|
||||
- run: touch artifacts/ONE artifacts/TWO
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: many-artifacts
|
||||
path: artifacts/
|
||||
|
||||
download-many:
|
||||
needs: [upload-many]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
|
||||
- run: |
|
||||
test -f many-artifacts/ONE
|
||||
test -f many-artifacts/TWO
|
||||
|
||||
upload-one:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: mkdir -p path/to/artifact
|
||||
|
||||
- run: echo hello > path/to/artifact/world.txt
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: my-artifact
|
||||
path: path/to/artifact/world.txt
|
||||
|
||||
download-one:
|
||||
needs: [upload-one]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: "! test -f world.txt"
|
||||
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: my-artifact
|
||||
|
||||
- run: "test -f world.txt"
|
@ -18,7 +18,5 @@ jobs:
|
||||
dotnet-version: ${{ matrix.dotnet-version }}
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
run: dotnet build --configuration Release --no-restore
|
||||
- name: Test
|
||||
run: dotnet test --no-restore --verbosity normal
|
@ -16,4 +16,8 @@
|
||||
<PackageReference Include="coverlet.collector" Version="3.1.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SmallInjector\SmallInjector.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,20 +1,17 @@
|
||||
namespace SmallInjector.Tests
|
||||
{
|
||||
namespace SmallInjector.Tests;
|
||||
|
||||
public class Tests
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup() { }
|
||||
|
||||
[Test]
|
||||
public void Test1()
|
||||
public void TestInstatiationAndRegistering()
|
||||
{
|
||||
Assert.Pass();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Test2()
|
||||
{
|
||||
Assert.Fail();
|
||||
}
|
||||
IContainer container = new Container();
|
||||
container.RegisterType(true, container);
|
||||
Assert.That(container.IsRegistered(typeof(IContainer)), Is.True);
|
||||
var resolved = container.Resolve<IContainer>();
|
||||
Assert.That(resolved, Is.EqualTo(container));
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ public class Container : IContainer
|
||||
{
|
||||
if (!IsRegistered<TInterface>())
|
||||
{
|
||||
_container[typeof(TInterface)] = new List<RegisteredType> { new RegisteredType(typeof(TService), isSingleton, null) };
|
||||
_container[typeof(TInterface)] = new List<RegisteredType> { new RegisteredType(typeof(TService), isSingleton, instance) };
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user