-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommonTests.cs
45 lines (37 loc) · 1.21 KB
/
CommonTests.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NiquIoC.Enums;
using NiquIoC.Exceptions;
using NiquIoC.Test.Model;
namespace NiquIoC.Test
{
[TestClass]
public class CommonTests
{
[TestMethod]
[ExpectedException(typeof(ResolveKindNotImplementedException))]
public void ClassNotRegistered_Fail()
{
var c = new Container();
c.RegisterType<EmptyClass>();
var emptyClass = c.Resolve<EmptyClass>((ResolveKind)3);
Assert.IsNull(emptyClass);
}
[TestMethod]
[ExpectedException(typeof(MissingResolveKindException))]
public void Resolve_Without_Parameter_When_Container_Without_ResolveKind_Fail()
{
var c = new Container();
c.RegisterType<EmptyClass>();
var emptyClass = c.Resolve<EmptyClass>();
Assert.IsNull(emptyClass);
}
[TestMethod]
[ExpectedException(typeof(MissingResolveKindException))]
public void BuildUp_Without_Parameter_When_Container_Without_ResolveKind_Fail()
{
var c = new Container();
var emptyClass = new EmptyClass();
c.BuildUp(emptyClass);
}
}
}