-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathmodel_test.mustache
87 lines (76 loc) · 2.29 KB
/
model_test.mustache
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{{>partial_header}}
using Xunit;
using System;
using System.Linq;
using System.IO;
using System.Collections.Generic;
using {{packageName}}.{{modelPackage}};
using {{packageName}}.{{clientPackage}};
using System.Reflection;
{{^useGenericHost}}
using Newtonsoft.Json;
{{/useGenericHost}}
{{#models}}
{{#model}}
namespace {{packageName}}.Test.Model
{
/// <summary>
/// Class for testing {{classname}}
/// </summary>
/// <remarks>
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
/// Please update the test case below to test the model.
/// </remarks>
public class {{classname}}Tests : IDisposable
{
// TODO uncomment below to declare an instance variable for {{classname}}
//private {{classname}} instance;
public {{classname}}Tests()
{
// TODO uncomment below to create an instance of {{classname}}
//instance = new {{classname}}();
}
public void Dispose()
{
// Cleanup when everything is done.
}
{{#lambda.trimTrailingWithNewLine}}
{{#lambda.trimLineBreaks}}
/// <summary>
/// Test an instance of {{classname}}
/// </summary>
[Fact]
public void {{classname}}InstanceTest()
{
// TODO uncomment below to test "IsType" {{classname}}
//Assert.IsType<{{classname}}>(instance);
}
{{#discriminator}}
{{#children}}
/// <summary>
/// Test deserialize a {{classname}} from type {{parent}}
/// </summary>
[Fact]
public void {{classname}}DeserializeFrom{{parent}}Test()
{
// TODO uncomment below to test deserialize a {{classname}} from type {{parent}}
//Assert.IsType<{{parent}}>(JsonConvert.DeserializeObject<{{parent}}>(new {{classname}}().ToJson()));
}
{{/children}}
{{/discriminator}}
{{#vars}}
/// <summary>
/// Test the property '{{name}}'
/// </summary>
[Fact]
public void {{name}}Test()
{
// TODO unit test for the property '{{name}}'
}
{{/vars}}
{{/lambda.trimLineBreaks}}
{{/lambda.trimTrailingWithNewLine}}
}
}
{{/model}}
{{/models}}