This repository has been archived by the owner on Feb 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from JacopoWolf/dev/3.2
3.1.1
- Loading branch information
Showing
10 changed files
with
181 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
tests/StackInjector.TEST.BlackBox/Features/Test.Versioning.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using NUnit.Framework; | ||
using StackInjector.Attributes; | ||
using StackInjector.Settings; | ||
|
||
namespace StackInjector.TEST.BlackBox.Features | ||
{ | ||
internal class Versioning | ||
{ | ||
#pragma warning disable CS0649 | ||
|
||
[Service] private class VersionClass {[Served] internal Level1A Level1_2; } | ||
|
||
[Test] | ||
public void ServerdVersioningClass () | ||
{ | ||
var settings = | ||
StackWrapperSettings.Default | ||
.InjectionVersioningMethod(ServedVersionTargetingMethod.LatestMajor,true); | ||
|
||
var versionedService = Injector.From<VersionClass>(settings).Entry.Level1_2; | ||
|
||
/* CLASSES ARE NOT VERSIONED, ONLY INTERFACES | ||
* this is why this tests checks if the field is not of Level1_2 | ||
*/ | ||
Assert.That(versionedService, Is.Not.InstanceOf<Level1_2>()); | ||
|
||
} | ||
|
||
|
||
[Test] | ||
public void SettingVersioningLatestMaj () | ||
{ | ||
var settings = | ||
StackWrapperSettings.Default | ||
.InjectionVersioningMethod(ServedVersionTargetingMethod.LatestMajor,true); | ||
|
||
var versionedService = Injector.From<InterfaceVersionedBase>( settings ).Entry.level1; | ||
|
||
Assert.That(versionedService, Is.TypeOf<Level1LatestVersion>()); | ||
} | ||
|
||
|
||
[Test] | ||
public void SettingVersioningLatestMin () | ||
{ | ||
var settings = | ||
StackWrapperSettings.Default | ||
.InjectionVersioningMethod(ServedVersionTargetingMethod.LatestMinor,true); | ||
|
||
var versionedService = Injector.From<InterfaceVersionedBase>( settings ).Entry.level1; | ||
|
||
Assert.That(versionedService, Is.TypeOf<Level1B>()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.