-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathAssemblyManagerTest.cs
68 lines (59 loc) · 2.02 KB
/
AssemblyManagerTest.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright (c) Mohamed Hassan & Contributors. All rights reserved. See License.md in the project root for license information.
namespace OData2Poco.Tests;
[TestFixture]
public class AssemblyManagerTest
{
[Test]
public void AddAssemblyTest()
{
var pocoSetting = new PocoSetting();
var am = new AssemblyManager(pocoSetting, []);
am.AddAssemply("xyz");
Assert.That(am._assemplyReference, Has.Member("xyz"));
}
[Test]
public void AddAsemplyArrayTest()
{
var pocosetting = new PocoSetting();
var am = new AssemblyManager(pocosetting, []);
am.AddAssemply("xyz", "abc");
Assert.That(am._assemplyReference, Has.Member("xyz"));
Assert.That(am._assemplyReference, Has.Member("abc"));
}
[Test]
[TestCase("key", "System.ComponentModel.DataAnnotations")]
[TestCase("req", "System.ComponentModel.DataAnnotations")]
[TestCase("tab", "System.ComponentModel.DataAnnotations.Schema")]
[TestCase("json", "Newtonsoft.Json")]
public void AddAsemplyByKey(string key, string value)
{
var pocosetting = new PocoSetting
{
Attributes = [key]
};
var am = new AssemblyManager(pocosetting, []);
Assert.That(am._assemplyReference, Has.Member(value));
}
[Test]
public void AddAsemplyMultiAttributes()
{
var pocosetting = new PocoSetting
{
Attributes = ["tab", "req"]
};
var am = new AssemblyManager(pocosetting, []);
Assert.That(am._assemplyReference, Has.Member("System.ComponentModel.DataAnnotations.Schema"));
}
[Test]
public void AddExternalAsemply()
{
var pocosetting = new PocoSetting
{
Attributes = ["tab", "req"]
};
var am = new AssemblyManager(pocosetting, []);
am.AddAssemply("xyz");
Assert.That(am._assemplyReference, Has.Member("System.ComponentModel.DataAnnotations.Schema"));
Assert.That(am._assemplyReference, Has.Member("xyz"));
}
}