Skip to content

Commit de42eb0

Browse files
author
José Miguel Sánchez Fernández
committed
Commit v1.0 from private repository
- Project ready to use. - All package metadata filled (for future NuGet publishing process). - All public API documented in code (included XML documentation file in build process and commit). - All tests passed in green.
1 parent fb16d16 commit de42eb0

43 files changed

Lines changed: 1615 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0</TargetFramework>
5+
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
11+
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
12+
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
13+
<PackageReference Include="coverlet.collector" Version="3.0.2" />
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\Argos.Framework.ServiceInjector\Argos.Framework.ServiceInjector.csproj" />
18+
</ItemGroup>
19+
20+
</Project>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
using Argos.Framework.ServiceInjector.Contracts.Interfaces;
2+
using System;
3+
using System.Collections.Generic;
4+
5+
namespace Argos.Framework.ServiceInjector.Tests.Classes
6+
{
7+
public class CustomArgosServiceContainerTestClass : IArgosServiceContainer
8+
{
9+
#region Properties
10+
public IReadOnlyList<IArgosServiceProvider> ServiceProviders { get; }
11+
#endregion
12+
13+
#region Methods & Functions
14+
public void AddService(Type template, Type implementation)
15+
{
16+
}
17+
18+
public void AddService<I, T>() where T : class
19+
{
20+
}
21+
22+
public void AddServiceProvider(IArgosServiceProvider serviceProvider)
23+
{
24+
}
25+
26+
public void AddServiceProviders(params IArgosServiceProvider[] serviceProviders)
27+
{
28+
}
29+
30+
public void AddSingleton(Type template, Type implementation)
31+
{
32+
33+
}
34+
35+
public void AddSingleton<I, T>() where T : class
36+
{
37+
}
38+
39+
public bool ContainsService<T>() => false;
40+
41+
public bool ContainsService(Type template) => false;
42+
43+
public object GetGenericService(Type template, params Type[] implementations) => null;
44+
45+
public object GetService(Type template) => null;
46+
47+
public I GetService<I>() => default;
48+
49+
public void RemoveService(Type template)
50+
{
51+
}
52+
53+
public void RemoveService<I>()
54+
{
55+
}
56+
57+
public void RemoveAllServices()
58+
{
59+
}
60+
61+
public void RemoveAllServiceProviders()
62+
{
63+
}
64+
#endregion
65+
}
66+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Argos.Framework.ServiceInjector.Contracts.Interfaces;
2+
using Argos.Framework.ServiceInjector.Tests.Classes.TestServices;
3+
using Argos.Framework.ServiceInjector.Tests.Classes.TestServices.SubServices;
4+
using Argos.Framework.ServiceInjector.Tests.Interfaces;
5+
using Argos.Framework.ServiceInjector.Tests.Interfaces.SubServices;
6+
7+
namespace Argos.Framework.ServiceInjector.Tests.Classes
8+
{
9+
public class CustomServiceProviderTestClass : AbstractArgosServiceProvider<CustomServiceProviderTestClass>
10+
{
11+
#region Methods & Functions
12+
public override void RegisterServices(IArgosServiceContainer serviceContainer)
13+
{
14+
serviceContainer.AddService<IColorStore, ColorStore>();
15+
serviceContainer.AddService<IColorFactory, ColorFactory>();
16+
serviceContainer.AddService<IStringFormatterService, StringFormatterService>();
17+
serviceContainer.AddService<IColorSelectorService, ColorSelectorService>();
18+
}
19+
#endregion
20+
}
21+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using Argos.Framework.ServiceInjector.Tests.Interfaces;
2+
3+
namespace Argos.Framework.ServiceInjector.Tests.Classes
4+
{
5+
public abstract class AbstractTestService : ITestService
6+
{
7+
}
8+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using Argos.Framework.ServiceInjector.Tests.Interfaces;
2+
using Argos.Framework.ServiceInjector.Tests.Interfaces.SubServices;
3+
4+
namespace Argos.Framework.ServiceInjector.Tests.Classes.TestServices
5+
{
6+
public class ColorSelectorService : IColorSelectorService
7+
{
8+
#region Internal vars
9+
private readonly IStringFormatterService _stringFormatterService;
10+
private readonly IColorFactory _colorFactory;
11+
#endregion
12+
13+
#region Constructor
14+
public ColorSelectorService(IColorFactory colorFactory, IStringFormatterService stringFormatterService)
15+
{
16+
this._colorFactory = colorFactory;
17+
this._stringFormatterService = stringFormatterService;
18+
}
19+
#endregion
20+
21+
#region Methods & Functions
22+
public string GetSelectedColorMessage()
23+
{
24+
string color = this._colorFactory.GetColor(IColorSelectorService.SELECTED_COLOR_INDEX);
25+
string result = this._stringFormatterService.FormatString(IColorSelectorService.MESSAGE_TEMPLATE, color);
26+
27+
return result;
28+
}
29+
#endregion
30+
}
31+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Argos.Framework.ServiceInjector.Tests.Interfaces;
2+
3+
namespace Argos.Framework.ServiceInjector.Tests.Classes.TestServices
4+
{
5+
public class CounterService : ICounterService
6+
{
7+
#region Properties
8+
public int Counter { get; set; }
9+
#endregion
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Argos.Framework.ServiceInjector.Tests.Interfaces;
2+
3+
namespace Argos.Framework.ServiceInjector.Tests.Classes
4+
{
5+
public class GenericTestService<T> : IGenericTestService<T>
6+
{
7+
#region Properties
8+
public T Field { get; set; }
9+
#endregion
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Argos.Framework.ServiceInjector.Tests.Interfaces;
2+
3+
namespace Argos.Framework.ServiceInjector.Tests.Classes
4+
{
5+
public class StringGenericTestService : IStringGenericTestService
6+
{
7+
#region Properties
8+
public string Field { get; set; }
9+
#endregion
10+
}
11+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using Argos.Framework.ServiceInjector.Tests.Interfaces.SubServices;
2+
3+
namespace Argos.Framework.ServiceInjector.Tests.Classes.TestServices.SubServices
4+
{
5+
public class ColorFactory : IColorFactory
6+
{
7+
#region Internal vars
8+
private readonly IColorStore _colorStore;
9+
#endregion
10+
11+
#region Constructor
12+
public ColorFactory(IColorStore colorStore) => this._colorStore = colorStore;
13+
#endregion
14+
15+
#region Methods & Functions
16+
public string GetColor(int index) => this._colorStore.Colors[index];
17+
#endregion
18+
}
19+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using Argos.Framework.ServiceInjector.Tests.Interfaces.SubServices;
2+
3+
namespace Argos.Framework.ServiceInjector.Tests.Classes.TestServices.SubServices
4+
{
5+
public class ColorStore : IColorStore
6+
{
7+
#region Properties
8+
public string[] Colors { get; }
9+
#endregion
10+
11+
#region Constructor
12+
public ColorStore() => this.Colors = new string[] { IColorStore.COLOR_RED, IColorStore.COLOR_GREEN, IColorStore.COLOR_BLUE };
13+
#endregion
14+
}
15+
}

0 commit comments

Comments
 (0)