-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathProjectGeneratorTest.cs
54 lines (50 loc) · 1.59 KB
/
ProjectGeneratorTest.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
// Copyright (c) Mohamed Hassan & Contributors. All rights reserved. See License.md in the project root for license information.
namespace OData2Poco.Tests;
public class ProjectGeneratorTest
{
[Test]
public void Generate_default_project_Test()
{
//Arrange
var attributes = new List<string>
{
string.Empty
};
//Act
var sut = new ProjectGenerator(attributes);
var text = sut.GetProjectCode().Trim();
var expected = File.ReadAllText(ProjectTestData.GenerateDefaultProjectTest).Trim();
//Assert
Assert.That(text.ToLines(), Is.EquivalentTo(expected.ToLines()));
}
[Test]
public void Generate_project_for_json_Test()
{
//Arrange
var attributes = new List<string>
{
"json"
};
//Act
var sut = new ProjectGenerator(attributes);
var text = sut.GetProjectCode().Trim();
//Assert
var expected = File.ReadAllText(ProjectTestData.GenerateProjectForJsonTest).Trim();
Assert.That(text.ToLines(), Is.EquivalentTo(expected.ToLines()));
}
[Test]
public void Generate_project_for_attributes_Test()
{
//Arrange
var attributes = new List<string>
{
"key"
};
var sut = new ProjectGenerator(attributes);
//Act
var text = sut.GetProjectCode().Trim();
//Assert
var expected = File.ReadAllText(ProjectTestData.GenerateProjectForAttributesTest).Trim();
Assert.That(text.ToLines(), Is.EquivalentTo(expected.ToLines()));
}
}