Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fe24535

Browse files
committed
Use raw strings.
1 parent fb05c52 commit fe24535

File tree

1 file changed

+35
-32
lines changed

1 file changed

+35
-32
lines changed

tests/Facility.CodeGen.JavaScript.UnitTests/JavaScriptGeneratorTests.cs

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -51,29 +51,30 @@ public void GenerateExampleApiTypeScript_IncludesEnums()
5151
Assert.IsNotNull(result);
5252

5353
var typesFile = result.Files.Single(f => f.Name == "exampleApiTypes.ts");
54-
const string expectedEnums = @"
55-
/** Identifies a widget field. */
56-
export enum WidgetField {
57-
/** The 'id' field. */
58-
id = 'id',
54+
const string expectedEnums = """
55+
/** Identifies a widget field. */
56+
export enum WidgetField {
57+
/** The 'id' field. */
58+
id = 'id',
5959
60-
/** The 'name' field. */
61-
name = 'name',
60+
/** The 'name' field. */
61+
name = 'name',
6262
63-
/**
64-
* The 'weight' field.
65-
* @deprecated
66-
*/
67-
weight = 'weight',
68-
}
63+
/**
64+
* The 'weight' field.
65+
* @deprecated
66+
*/
67+
weight = 'weight',
68+
}
6969
70-
/**
71-
* An obsolete enum.
72-
* @deprecated
73-
*/
74-
export enum ObsoleteEnum {
75-
unused = 'unused',
76-
}";
70+
/**
71+
* An obsolete enum.
72+
* @deprecated
73+
*/
74+
export enum ObsoleteEnum {
75+
unused = 'unused',
76+
}
77+
""";
7778
Assert.That(typesFile.Text, Contains.Substring(expectedEnums));
7879

7980
const string expectedEnumUsage = "widgetField?: WidgetField;";
@@ -104,21 +105,23 @@ public void GenerateExampleApiTypeScript_DoesntRequireJsonWhenNoResponseBodyExpe
104105
var apiFile = result.Files.Single(f => f.Name == "exampleApi.ts");
105106

106107
// `deleteWidget` does not expect response body
107-
const string expectedDeleteWidgetLines = @"
108-
let value: IDeleteWidgetResponse | null = null;
109-
if (status === 204) {
110-
value = {};
111-
}";
108+
const string expectedDeleteWidgetLines = """
109+
let value: IDeleteWidgetResponse | null = null;
110+
if (status === 204) {
111+
value = {};
112+
}
113+
""";
112114
Assert.That(apiFile.Text, Contains.Substring(expectedDeleteWidgetLines));
113115

114116
// `createWidget` does expect response body
115-
const string expectedCreateWidgetLines = @"
116-
let value: ICreateWidgetResponse | null = null;
117-
if (status === 201) {
118-
if (result.json) {
119-
value = { widget: result.json } as ICreateWidgetResponse;
120-
}
121-
}";
117+
const string expectedCreateWidgetLines = """
118+
let value: ICreateWidgetResponse | null = null;
119+
if (status === 201) {
120+
if (result.json) {
121+
value = { widget: result.json } as ICreateWidgetResponse;
122+
}
123+
}
124+
""";
122125
Assert.That(apiFile.Text, Contains.Substring(expectedCreateWidgetLines));
123126
}
124127
}

0 commit comments

Comments
 (0)