Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/http-client-csharp/eng/scripts/Generate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ $failingSpecs = @(
Join-Path 'http' 'special-headers' 'conditional-request'
Join-Path 'http' 'special-headers' 'repeatability'
Join-Path 'http' 'type' 'dictionary'
Join-Path 'http' 'type' 'enum' 'fixed'
Join-Path 'http' 'type' 'model' 'empty'
Join-Path 'http' 'type' 'model' 'flatten'
Join-Path 'http' 'type' 'model' 'usage'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
"commandName": "Executable",
"executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe"
},
"http-type-enum-fixed": {
"commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/type/enum/fixed -p StubLibraryPlugin",
"commandName": "Executable",
"executablePath": "$(SolutionDir)/../dist/generator/Microsoft.Generator.CSharp.exe"
},
"http-type-scalar": {
"commandLineArgs": "$(SolutionDir)/TestProjects/CadlRanch/http/type/scalar -p StubLibraryPlugin",
"commandName": "Executable",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.ClientModel;
using System.Threading.Tasks;
using _Type._Enum.Fixed;
using _Type._Enum.Fixed.Models;
using NUnit.Framework;

namespace TestProjects.CadlRanch.Tests.Http._Type._Enum.Fixed
{
internal class FixedTests : CadlRanchTestBase
{
[CadlRanchTest]
public Task Type_Enum_Fixed_String_getKnownValue() => Test(async (host) =>
{
var response = await new FixedClient(host, null).GetStringClient().GetKnownValueAsync();
Assert.AreEqual(DaysOfWeekEnum.Monday, response.Value);
});

[CadlRanchTest]
public Task Type_Enum_Fixed_String_putKnownValue() => Test(async (host) =>
{
var response = await new FixedClient(host, null).GetStringClient().PutKnownValueAsync(DaysOfWeekEnum.Monday);
Assert.AreEqual(204, response.GetRawResponse().Status);
});

[CadlRanchTest]
public Task Type_Enum_Fixed_String_putUnknownValue() => Test((host) =>
{
var exception = Assert.ThrowsAsync<ClientResultException>(() => new FixedClient(host, null).GetStringClient().PutUnknownValueAsync(BinaryContent.Create(BinaryData.FromObjectAsJson("Weekend")), null));
Assert.IsNotNull(exception?.GetRawResponse());
Assert.AreEqual(500, exception?.GetRawResponse()?.Status);
return Task.CompletedTask;
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"output-folder": ".",
"namespace": "Type.Enum.Fixed",
"library-name": "Type.Enum.Fixed",
"use-model-reader-writer": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29709.97
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_Type._Enum.Fixed", "src\_Type._Enum.Fixed.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU
{8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU
{A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// <auto-generated/>

#nullable disable

using System;
using System.ClientModel.Primitives;

namespace _Type._Enum.Fixed
{
public partial class FixedClient
{
public FixedClient() : this(new Uri("http://localhost:3000"), new FixedClientOptions()) => throw null;

public FixedClient(Uri endpoint, FixedClientOptions options) => throw null;

public ClientPipeline Pipeline => throw null;

public virtual String GetStringClient() => throw null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// <auto-generated/>

#nullable disable

using System.ClientModel.Primitives;

namespace _Type._Enum.Fixed
{
public partial class FixedClientOptions : ClientPipelineOptions
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// <auto-generated/>

#nullable disable

namespace _Type._Enum.Fixed.Models
{
public enum DaysOfWeekEnum
{
/// <summary> Monday. </summary>
Monday,
/// <summary> Tuesday. </summary>
Tuesday,
/// <summary> Wednesday. </summary>
Wednesday,
/// <summary> Thursday. </summary>
Thursday,
/// <summary> Friday. </summary>
Friday,
/// <summary> Saturday. </summary>
Saturday,
/// <summary> Sunday. </summary>
Sunday
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// <auto-generated/>

#nullable disable

using System.ClientModel;
using System.ClientModel.Primitives;
using System.Threading.Tasks;
using _Type._Enum.Fixed.Models;

namespace _Type._Enum.Fixed
{
public partial class String
{
protected String() => throw null;

public ClientPipeline Pipeline => throw null;

public virtual ClientResult GetKnownValue(RequestOptions options) => throw null;

public virtual Task<ClientResult> GetKnownValueAsync(RequestOptions options) => throw null;

public virtual ClientResult<DaysOfWeekEnum> GetKnownValue() => throw null;

public virtual Task<ClientResult<DaysOfWeekEnum>> GetKnownValueAsync() => throw null;

public virtual ClientResult PutKnownValue(BinaryContent content, RequestOptions options) => throw null;

public virtual Task<ClientResult> PutKnownValueAsync(BinaryContent content, RequestOptions options) => throw null;

public virtual ClientResult PutKnownValue(DaysOfWeekEnum body) => throw null;

public virtual Task<ClientResult> PutKnownValueAsync(DaysOfWeekEnum body) => throw null;

public virtual ClientResult PutUnknownValue(BinaryContent content, RequestOptions options) => throw null;

public virtual Task<ClientResult> PutUnknownValueAsync(BinaryContent content, RequestOptions options) => throw null;

public virtual ClientResult PutUnknownValue(DaysOfWeekEnum body) => throw null;

public virtual Task<ClientResult> PutUnknownValueAsync(DaysOfWeekEnum body) => throw null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>This is the _Type._Enum.Fixed client library for developing .NET applications with rich experience.</Description>
<AssemblyTitle>SDK Code Generation _Type._Enum.Fixed</AssemblyTitle>
<Version>1.0.0-beta.1</Version>
<PackageTags>_Type._Enum.Fixed</PackageTags>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.ClientModel" Version="1.1.0-beta.4" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>
</Project>
Loading