-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b42a16f
commit 3b39806
Showing
60 changed files
with
1,955 additions
and
1,266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
178 changes: 89 additions & 89 deletions
178
...tp-client-csharp/generator/TestProjects/CadlRanch.Tests/Http/Client/Naming/NamingTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,109 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System.Threading.Tasks; | ||
using Client.Naming; | ||
using Client.Naming.Models; | ||
using NUnit.Framework; | ||
using ClientModel = Client.Naming.Models.ClientModel; | ||
// using System.Threading.Tasks; | ||
// using Client.Naming; | ||
// using Client.Naming.Models; | ||
// using NUnit.Framework; | ||
// using ClientModel = Client.Naming.Models.ClientModel; | ||
|
||
namespace TestProjects.CadlRanch.Tests.Http.Client.Naming | ||
{ | ||
public class ClientNamingTests : CadlRanchTestBase | ||
{ | ||
[CadlRanchTest] | ||
public Task Client() => Test(async (host) => | ||
{ | ||
var response = await new NamingClient(host, null).ClientAsync(new ClientNameModel(true)); | ||
Assert.AreEqual(204, response.GetRawResponse().Status); | ||
// public class ClientNamingTests : CadlRanchTestBase | ||
// { | ||
// [CadlRanchTest] | ||
// public Task Client() => Test(async (host) => | ||
// { | ||
// var response = await new NamingClient(host, null).ClientAsync(new ClientNameModel(true)); | ||
// Assert.AreEqual(204, response.GetRawResponse().Status); | ||
|
||
Assert.NotNull(typeof(ClientNameModel).GetProperty("ClientName")); | ||
Assert.IsNull(typeof(ClientNameModel).GetProperty("DefaultName")); | ||
}); | ||
// Assert.NotNull(typeof(ClientNameModel).GetProperty("ClientName")); | ||
// Assert.IsNull(typeof(ClientNameModel).GetProperty("DefaultName")); | ||
// }); | ||
|
||
[CadlRanchTest] | ||
public Task Language() => Test(async (host) => | ||
{ | ||
var response = await new NamingClient(host, null).LanguageAsync(new LanguageClientNameModel(true)); | ||
Assert.AreEqual(204, response.GetRawResponse().Status); | ||
// [CadlRanchTest] | ||
// public Task Language() => Test(async (host) => | ||
// { | ||
// var response = await new NamingClient(host, null).LanguageAsync(new LanguageClientNameModel(true)); | ||
// Assert.AreEqual(204, response.GetRawResponse().Status); | ||
|
||
Assert.NotNull(typeof(LanguageClientNameModel).GetProperty("CSName")); | ||
Assert.IsNull(typeof(LanguageClientNameModel).GetProperty("DefaultName")); | ||
}); | ||
// Assert.NotNull(typeof(LanguageClientNameModel).GetProperty("CSName")); | ||
// Assert.IsNull(typeof(LanguageClientNameModel).GetProperty("DefaultName")); | ||
// }); | ||
|
||
[CadlRanchTest] | ||
public Task CompatibleWithEncodedName() => Test(async (host) => | ||
{ | ||
var response = await new NamingClient(host, null).CompatibleWithEncodedNameAsync(new ClientNameAndJsonEncodedNameModel(true)); | ||
Assert.AreEqual(204, response.GetRawResponse().Status); | ||
// [CadlRanchTest] | ||
// public Task CompatibleWithEncodedName() => Test(async (host) => | ||
// { | ||
// var response = await new NamingClient(host, null).CompatibleWithEncodedNameAsync(new ClientNameAndJsonEncodedNameModel(true)); | ||
// Assert.AreEqual(204, response.GetRawResponse().Status); | ||
|
||
Assert.NotNull(typeof(ClientNameModel).GetProperty("ClientName")); | ||
Assert.IsNull(typeof(ClientNameModel).GetProperty("DefaultName")); | ||
}); | ||
// Assert.NotNull(typeof(ClientNameModel).GetProperty("ClientName")); | ||
// Assert.IsNull(typeof(ClientNameModel).GetProperty("DefaultName")); | ||
// }); | ||
|
||
[CadlRanchTest] | ||
public Task Operation() => Test(async (host) => | ||
{ | ||
var response = await new NamingClient(host, null).ClientNameAsync(); | ||
Assert.AreEqual(204, response.GetRawResponse().Status); | ||
}); | ||
// [CadlRanchTest] | ||
// public Task Operation() => Test(async (host) => | ||
// { | ||
// var response = await new NamingClient(host, null).ClientNameAsync(); | ||
// Assert.AreEqual(204, response.GetRawResponse().Status); | ||
// }); | ||
|
||
[CadlRanchTest] | ||
public Task Parameter() => Test(async (host) => | ||
{ | ||
var response = await new NamingClient(host, null).ParameterAsync(clientName: "true"); | ||
Assert.AreEqual(204, response.GetRawResponse().Status); | ||
}); | ||
// [CadlRanchTest] | ||
// public Task Parameter() => Test(async (host) => | ||
// { | ||
// var response = await new NamingClient(host, null).ParameterAsync(clientName: "true"); | ||
// Assert.AreEqual(204, response.GetRawResponse().Status); | ||
// }); | ||
|
||
[CadlRanchTest] | ||
public Task Request() => Test(async (host) => | ||
{ | ||
var response = await new NamingClient(host, null).RequestAsync(clientName: "true"); | ||
Assert.AreEqual(204, response.GetRawResponse().Status); | ||
}); | ||
// [CadlRanchTest] | ||
// public Task Request() => Test(async (host) => | ||
// { | ||
// var response = await new NamingClient(host, null).RequestAsync(clientName: "true"); | ||
// Assert.AreEqual(204, response.GetRawResponse().Status); | ||
// }); | ||
|
||
[CadlRanchTest] | ||
public Task Response() => Test(async (host) => | ||
{ | ||
var response = await new NamingClient(host, null).ResponseAsync(); | ||
Assert.IsTrue(response.GetRawResponse().Headers.TryGetValue("default-name", out _)); | ||
foreach (var header in response.GetRawResponse().Headers) | ||
{ | ||
var key = header.Key; | ||
if (key == "default-name") | ||
{ | ||
var value = header.Value; | ||
Assert.AreEqual("true", value); | ||
} | ||
} | ||
}); | ||
// [CadlRanchTest] | ||
// public Task Response() => Test(async (host) => | ||
// { | ||
// var response = await new NamingClient(host, null).ResponseAsync(); | ||
// Assert.IsTrue(response.GetRawResponse().Headers.TryGetValue("default-name", out _)); | ||
// foreach (var header in response.GetRawResponse().Headers) | ||
// { | ||
// var key = header.Key; | ||
// if (key == "default-name") | ||
// { | ||
// var value = header.Value; | ||
// Assert.AreEqual("true", value); | ||
// } | ||
// } | ||
// }); | ||
|
||
[CadlRanchTest] | ||
public Task ModelClient() => Test(async (host) => | ||
{ | ||
var response = await new NamingClient(host, null).GetClientModelClient().ClientAsync(new ClientModel(true)); | ||
Assert.AreEqual(204, response.GetRawResponse().Status); | ||
}); | ||
// [CadlRanchTest] | ||
// public Task ModelClient() => Test(async (host) => | ||
// { | ||
// var response = await new NamingClient(host, null).GetClientModelClient().ClientAsync(new ClientModel(true)); | ||
// Assert.AreEqual(204, response.GetRawResponse().Status); | ||
// }); | ||
|
||
[CadlRanchTest] | ||
public Task ModelLanguage() => Test(async (host) => | ||
{ | ||
var response = await new NamingClient(host, null).GetClientModelClient().LanguageAsync(new CSModel(true)); | ||
Assert.AreEqual(204, response.GetRawResponse().Status); | ||
}); | ||
// [CadlRanchTest] | ||
// public Task ModelLanguage() => Test(async (host) => | ||
// { | ||
// var response = await new NamingClient(host, null).GetClientModelClient().LanguageAsync(new CSModel(true)); | ||
// Assert.AreEqual(204, response.GetRawResponse().Status); | ||
// }); | ||
|
||
[CadlRanchTest] | ||
public Task UnionEnumName() => Test(async (host) => | ||
{ | ||
var response = await new NamingClient(host, null).GetUnionEnumClient().UnionEnumNameAsync(ClientExtensibleEnum.EnumValue1); | ||
Assert.AreEqual(204, response.GetRawResponse().Status); | ||
}); | ||
// [CadlRanchTest] | ||
// public Task UnionEnumName() => Test(async (host) => | ||
// { | ||
// var response = await new NamingClient(host, null).GetUnionEnumClient().UnionEnumNameAsync(ClientExtensibleEnum.EnumValue1); | ||
// Assert.AreEqual(204, response.GetRawResponse().Status); | ||
// }); | ||
|
||
[CadlRanchTest] | ||
public Task UnionEnumMemberName() => Test(async (host) => | ||
{ | ||
var response = await new NamingClient(host, null).GetUnionEnumClient().UnionEnumMemberNameAsync(ExtensibleEnum.ClientEnumValue1); | ||
Assert.AreEqual(204, response.GetRawResponse().Status); | ||
}); | ||
} | ||
// [CadlRanchTest] | ||
// public Task UnionEnumMemberName() => Test(async (host) => | ||
// { | ||
// var response = await new NamingClient(host, null).GetUnionEnumClient().UnionEnumMemberNameAsync(ExtensibleEnum.ClientEnumValue1); | ||
// Assert.AreEqual(204, response.GetRawResponse().Status); | ||
// }); | ||
// } | ||
} |
5 changes: 2 additions & 3 deletions
5
...s/CadlRanch.Tests/Http/Client/Structure/ClientOperationGroup/ClientOperationGroupTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
.../generator/TestProjects/CadlRanch.Tests/Http/Encode/DateTime/Encode.DateTime.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.Memory.Data" /> | ||
<PackageReference Include="System.ClientModel" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="$(RepoRoot)\Microsoft.Generator.CSharp\test\common\Microsoft.Generator.CSharp.Tests.Common.csproj" /> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch\http\encode\datetime\src\Encode.DateTime.csproj" /> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch.Tests\TestProjects.CadlRanch.Tests.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
15 changes: 15 additions & 0 deletions
15
.../generator/TestProjects/CadlRanch.Tests/Http/Encode/Duration/Encode.Duration.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.Memory.Data" /> | ||
<PackageReference Include="System.ClientModel" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="$(RepoRoot)\Microsoft.Generator.CSharp\test\common\Microsoft.Generator.CSharp.Tests.Common.csproj" /> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch\http\encode\duration\src\Encode.Duration.csproj" /> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch.Tests\TestProjects.CadlRanch.Tests.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
15 changes: 15 additions & 0 deletions
15
...rp/generator/TestProjects/CadlRanch.Tests/Http/Encode/Numeric/Encode.Numeric.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.Memory.Data" /> | ||
<PackageReference Include="System.ClientModel" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="$(RepoRoot)\Microsoft.Generator.CSharp\test\common\Microsoft.Generator.CSharp.Tests.Common.csproj" /> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch\http\encode\numeric\src\Encode.Numeric.csproj" /> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch.Tests\TestProjects.CadlRanch.Tests.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
15 changes: 15 additions & 0 deletions
15
...enerator/TestProjects/CadlRanch.Tests/Http/Parameters/Basic/Parameters.Basic.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.Memory.Data" /> | ||
<PackageReference Include="System.ClientModel" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="$(RepoRoot)\Microsoft.Generator.CSharp\test\common\Microsoft.Generator.CSharp.Tests.Common.csproj" /> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch\http\parameters\basic\src\Parameters.Basic.csproj" /> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch.Tests\TestProjects.CadlRanch.Tests.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
15 changes: 15 additions & 0 deletions
15
...s/CadlRanch.Tests/Http/Parameters/BodyOptionality/Parameters.BodyOptionality.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.Memory.Data" /> | ||
<PackageReference Include="System.ClientModel" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="$(RepoRoot)\Microsoft.Generator.CSharp\test\common\Microsoft.Generator.CSharp.Tests.Common.csproj" /> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch\http\parameters\body-optionality\src\Parameters.BodyOptionality.csproj" /> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch.Tests\TestProjects.CadlRanch.Tests.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
15 changes: 15 additions & 0 deletions
15
...CadlRanch.Tests/Http/Parameters/CollectionFormat/Parameters.CollectionFormat.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.Memory.Data" /> | ||
<PackageReference Include="System.ClientModel" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="$(RepoRoot)\Microsoft.Generator.CSharp\test\common\Microsoft.Generator.CSharp.Tests.Common.csproj" /> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch\http\parameters\collection-format\src\Parameters.CollectionFormat.csproj" /> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch.Tests\TestProjects.CadlRanch.Tests.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
15 changes: 15 additions & 0 deletions
15
...erator/TestProjects/CadlRanch.Tests/Http/Parameters/Spread/Parameters.Spread.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="System.Memory.Data" /> | ||
<PackageReference Include="System.ClientModel" /> | ||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="$(RepoRoot)\Microsoft.Generator.CSharp\test\common\Microsoft.Generator.CSharp.Tests.Common.csproj" /> | ||
<!-- <ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch\http\parameters\spread\src\Parameters.Spread.csproj" /> --> | ||
<ProjectReference Include="$(RepoRoot)\TestProjects\CadlRanch.Tests\TestProjects.CadlRanch.Tests.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.