Skip to content

Commit 075e197

Browse files
committed
Add test cases.
1 parent 8ebb292 commit 075e197

File tree

2 files changed

+28
-9
lines changed

2 files changed

+28
-9
lines changed

src/WebApiTestApplication/Controllers/TestController.cs

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ public class AnotherClass
6767
public string[] List { get; set; }
6868
}
6969

70+
public class DerivedClassWithShadowedProperty : AnotherClass
71+
{
72+
public new string Number { get; set; }
73+
}
74+
75+
public class DerivedClassWithAnotherShadowedProperty : DerivedClassWithShadowedProperty
76+
{
77+
public new int Number { get; set; }
78+
}
79+
7080
[RoutePrefix("api/Test/{hole}/actions")]
7181
public class TestController : ApiController
7282
{
@@ -83,14 +93,7 @@ public string Get([EncryptedInt] int id, string hole)
8393
{
8494
return $"value {hole} / {id}";
8595
}
86-
87-
//[HttpGet]
88-
//[Route("getty/{id:encryptedInt}")]
89-
//public string Getty(int id, string hole)
90-
//{
91-
// return $"{nameof(Getty)}: value {hole} / {id}";
92-
//}
93-
96+
9497
[HttpGet]
9598
[Route("getSomething/{id}/ha")]
9699
public string GetSomething(string hole, int id, DummyEnum y = DummyEnum.Bye)
@@ -113,6 +116,22 @@ public string Post(string hole, DummyClass value)
113116
return $"thanks for the {valueJson} in the {hole}";
114117
}
115118

119+
[HttpPost]
120+
[Route("derived")]
121+
public string Post(DerivedClassWithShadowedProperty value)
122+
{
123+
var valueJson = JsonConvert.SerializeObject(value);
124+
return $"thanks for the {valueJson}";
125+
}
126+
127+
[HttpPost]
128+
[Route("derivedAgain")]
129+
public string Post(DerivedClassWithAnotherShadowedProperty value)
130+
{
131+
var valueJson = JsonConvert.SerializeObject(value);
132+
return $"thanks for the {valueJson}";
133+
}
134+
116135
[HttpPut]
117136
[Route("{id}")]
118137
public string Put(int id, [FromBody]string value, string hole)

src/WebApiTestApplication/WebApiTestApplication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<UseGlobalApplicationHostFile />
2626
<NuGetPackageImportStamp>
2727
</NuGetPackageImportStamp>
28-
<TypeScriptToolsVersion>1.8</TypeScriptToolsVersion>
28+
<TypeScriptToolsVersion>2.0</TypeScriptToolsVersion>
2929
</PropertyGroup>
3030
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
3131
<DebugSymbols>true</DebugSymbols>

0 commit comments

Comments
 (0)