Merge pull request #59 from theKBro/splitValidationProject
Split package into multiple packagesImplementExpressionTrees
commit
908f3d65c5
12 changed files with 190 additions and 62 deletions
@ -0,0 +1,46 @@ |
||||
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>net6.0</TargetFramework> |
||||
<Authors>SimonG</Authors> |
||||
<Copyright>Copyright(c) 2022 SimonG. All Rights Reserved.</Copyright> |
||||
<Description>A lightweight IOC Container Validator.</Description> |
||||
<RepositoryUrl>https://github.com/SimonG96/LightweightIocContainer</RepositoryUrl> |
||||
<LangVersion>default</LangVersion> |
||||
<Nullable>enable</Nullable> |
||||
<ImplicitUsings>enable</ImplicitUsings> |
||||
<DocumentationFile>LightweightIocContainer.Validation.xml</DocumentationFile> |
||||
<VersionPrefix>4.0.0</VersionPrefix> |
||||
<VersionSuffix>beta5</VersionSuffix> |
||||
</PropertyGroup> |
||||
|
||||
<PropertyGroup> |
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> |
||||
<PackageProjectUrl>https://github.com/SimonG96/LightweightIocContainer</PackageProjectUrl> |
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression> |
||||
<PackageReadmeFile>README.md</PackageReadmeFile> |
||||
<IncludeSymbols>true</IncludeSymbols> |
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> |
||||
</PropertyGroup> |
||||
|
||||
<ItemGroup> |
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1"> |
||||
<PrivateAssets>all</PrivateAssets> |
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
||||
</PackageReference> |
||||
<PackageReference Include="Moq" Version="4.18.2" /> |
||||
<PackageReference Include="System.Reflection.Emit" Version="4.7.0" /> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<Content Include="README.md" Pack="true" PackagePath="" /> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup Condition="Exists('..\LightweightIocContainer\LightweightIocContainer.csproj')"> |
||||
<ProjectReference Include="..\LightweightIocContainer\LightweightIocContainer.csproj" /> |
||||
</ItemGroup> |
||||
<ItemGroup Condition="!Exists('..\LightweightIocContainer\LightweightIocContainer.csproj')"> |
||||
<PackageReference Include="LightweightIocContainer" Version="$(Version)" /> |
||||
</ItemGroup> |
||||
|
||||
</Project> |
||||
@ -0,0 +1,33 @@ |
||||
<?xml version="1.0"?> |
||||
<doc> |
||||
<assembly> |
||||
<name>LightweightIocContainer.Validation</name> |
||||
</assembly> |
||||
<members> |
||||
<member name="T:LightweightIocContainer.Validation.IocValidator"> |
||||
<summary> |
||||
Validator for your <see cref="T:LightweightIocContainer.IocContainer"/> to check if everything can be resolved with your current setup |
||||
</summary> |
||||
</member> |
||||
<member name="M:LightweightIocContainer.Validation.IocValidator.#ctor(LightweightIocContainer.IocContainer)"> |
||||
<summary> |
||||
Validator for your <see cref="T:LightweightIocContainer.IocContainer"/> to check if everything can be resolved with your current setup |
||||
</summary> |
||||
<param name="iocContainer">The <see cref="T:LightweightIocContainer.IocContainer"/></param> |
||||
</member> |
||||
<member name="M:LightweightIocContainer.Validation.IocValidator.AddParameter``2(``1)"> |
||||
<summary> |
||||
Add parameters that can't be default for your type to be created successfully |
||||
</summary> |
||||
<param name="parameter">The new value of the parameter</param> |
||||
<typeparam name="TInterface">The <see cref="T:System.Type"/> of your registered interface</typeparam> |
||||
<typeparam name="TParameter">The <see cref="T:System.Type"/> of your <paramref name="parameter"></paramref></typeparam> |
||||
</member> |
||||
<member name="M:LightweightIocContainer.Validation.IocValidator.Validate"> |
||||
<summary> |
||||
Validates your given <see cref="T:LightweightIocContainer.IocContainer"/> and checks if everything can be resolved with the current setup |
||||
<exception cref="T:System.AggregateException">Collection of all exceptions that are thrown during validation</exception> |
||||
</summary> |
||||
</member> |
||||
</members> |
||||
</doc> |
||||
@ -0,0 +1,54 @@ |
||||
# Lightweight IOC Container |
||||
|
||||
A lightweight IOC Container that is powerful enough to do all the things you need it to do. |
||||
|
||||
[](https://github.com/SimonG96/LightweightIocContainer/actions) |
||||
|
||||
[](https://www.nuget.org/packages/LightweightIocContainer/) |
||||
[](https://www.nuget.org/packages/LightweightIocContainer/) |
||||
[](https://www.nuget.org/packages/LightweightIocContainer/) |
||||
|
||||
## Get started with the Lightweight IOC Container Validator |
||||
|
||||
### How to install |
||||
|
||||
The easiest way to [install](https://github.com/SimonG96/LightweightIocContainer/wiki/Install-Lightweight-IOC-Container) the Lightweight IOC Container is by using [NuGet](https://www.nuget.org/packages/LightweightIocContainer/). |
||||
You can either use the [`PackageManager`](https://github.com/SimonG96/LightweightIocContainer/wiki/Install-Lightweight-IOC-Container#packagemanager) in VisualStudio: |
||||
|
||||
```PM |
||||
PM> Install-Package LightweightIocContainer.Validator -Version 4.0.0-beta4 |
||||
``` |
||||
|
||||
or you can use the [`.NET CLI`](https://github.com/SimonG96/LightweightIocContainer/wiki/Install-Lightweight-IOC-Container#net-cli): |
||||
|
||||
```.net |
||||
> dotnet add package LightweightIocContainer.Validator --version 4.0.0-beta4 |
||||
``` |
||||
|
||||
### Validation |
||||
|
||||
You can validate your `IocContainer` setup by using the `IocValidator` in a unit test: |
||||
|
||||
```c# |
||||
[TestFixture] |
||||
public class IocValidationTest |
||||
{ |
||||
[Test] |
||||
public void ValidateIocContainerSetup() |
||||
{ |
||||
IocContainer container = new(); |
||||
container.Install(new Installer()); |
||||
|
||||
IocValidator validator = new(container); |
||||
validator.Validate(); |
||||
} |
||||
} |
||||
``` |
||||
|
||||
If this test is successful, everything is correctly installed and can be resolved by the `IocContainer`. By going through the thrown exceptions in case of a failed test you will see what is not working correctly with your current setup. |
||||
|
||||
### Demo Project |
||||
|
||||
There is a [demo project][demoProjectLink] available where you can check out how different functions of the Lightweight IOC Container can be used. |
||||
|
||||
[demoProjectLink]: https://github.com/SimonG96/LightweightIocContainer_Example |
||||
@ -0,0 +1,26 @@ |
||||
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>net6.0</TargetFramework> |
||||
<IsPackable>false</IsPackable> |
||||
<Authors>SimonG</Authors> |
||||
<LangVersion>default</LangVersion> |
||||
<ImplicitUsings>enable</ImplicitUsings> |
||||
</PropertyGroup> |
||||
|
||||
<ItemGroup> |
||||
<PackageReference Include="JetBrains.Annotations" Version="2022.1.0" /> |
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" /> |
||||
<PackageReference Include="Moq" Version="4.18.2" /> |
||||
<PackageReference Include="nunit" Version="3.13.3" /> |
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1"> |
||||
<PrivateAssets>all</PrivateAssets> |
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> |
||||
</PackageReference> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<ProjectReference Include="..\LightweightIocContainer.Validation\LightweightIocContainer.Validation.csproj" /> |
||||
</ItemGroup> |
||||
|
||||
</Project> |
||||
Loading…
Reference in new issue