Bumped package version to 1.4.5 and modified ClientGenerator to include System.Net assembly as a DotNet type.
This commit is contained in:
parent
71941f5dd0
commit
4bc388d86b
23
Rest.Net.Tests/RestClientGeneratorTests.cs
Normal file
23
Rest.Net.Tests/RestClientGeneratorTests.cs
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Xunit;
|
||||||
|
using FluentAssertions;
|
||||||
|
using MontoyaTech.Rest.Net;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
namespace Rest.Net.Tests
|
||||||
|
{
|
||||||
|
public class RestClientGeneratorTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void RestClientGenerator_HttpStatusCode_Should_BeSystemType()
|
||||||
|
{
|
||||||
|
var generator = new RestClientGenerator();
|
||||||
|
|
||||||
|
generator.IsTypeDotNet(typeof(HttpStatusCode)).Should().BeTrue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -17,7 +17,7 @@
|
|||||||
<AssemblyName>MontoyaTech.Rest.Net</AssemblyName>
|
<AssemblyName>MontoyaTech.Rest.Net</AssemblyName>
|
||||||
<RootNamespace>MontoyaTech.Rest.Net</RootNamespace>
|
<RootNamespace>MontoyaTech.Rest.Net</RootNamespace>
|
||||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||||
<Version>1.4.4</Version>
|
<Version>1.4.5</Version>
|
||||||
<PackageReleaseNotes></PackageReleaseNotes>
|
<PackageReleaseNotes></PackageReleaseNotes>
|
||||||
<PackageIcon>Logo_Symbol_Black_Outline.png</PackageIcon>
|
<PackageIcon>Logo_Symbol_Black_Outline.png</PackageIcon>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -27,12 +27,11 @@ namespace MontoyaTech.Rest.Net
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type"></param>
|
/// <param name="type"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected virtual bool IsTypeDotNet(Type type)
|
protected internal virtual bool IsTypeDotNet(Type type)
|
||||||
{
|
{
|
||||||
if (type.Assembly.GetName().Name == "System.Private.CoreLib")
|
var assemblyName = type.Assembly.GetName().Name;
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
return assemblyName == "System.Private.CoreLib" || assemblyName == "System.Net.Primitives";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -40,7 +39,7 @@ namespace MontoyaTech.Rest.Net
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type"></param>
|
/// <param name="type"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected virtual List<Type> FindTypeDependencies(Type type)
|
protected internal virtual List<Type> FindTypeDependencies(Type type)
|
||||||
{
|
{
|
||||||
var dependencies = new HashSet<Type>();
|
var dependencies = new HashSet<Type>();
|
||||||
|
|
||||||
@ -116,7 +115,7 @@ namespace MontoyaTech.Rest.Net
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="route"></param>
|
/// <param name="route"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected virtual List<Type> FindRouteDependencies(Route route)
|
protected internal virtual List<Type> FindRouteDependencies(Route route)
|
||||||
{
|
{
|
||||||
var dependencies = new HashSet<Type>();
|
var dependencies = new HashSet<Type>();
|
||||||
|
|
||||||
@ -187,7 +186,7 @@ namespace MontoyaTech.Rest.Net
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="routes"></param>
|
/// <param name="routes"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected virtual List<Type> FindRoutesDependencies(List<Route> routes)
|
protected internal virtual List<Type> FindRoutesDependencies(List<Route> routes)
|
||||||
{
|
{
|
||||||
var dependencies = new HashSet<Type>();
|
var dependencies = new HashSet<Type>();
|
||||||
|
|
||||||
@ -209,7 +208,7 @@ namespace MontoyaTech.Rest.Net
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="type"></param>
|
/// <param name="type"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected virtual string GetTypeFullyResolvedName(Type type)
|
protected internal virtual string GetTypeFullyResolvedName(Type type)
|
||||||
{
|
{
|
||||||
if (this.IsTypeDotNet(type))
|
if (this.IsTypeDotNet(type))
|
||||||
{
|
{
|
||||||
@ -319,7 +318,7 @@ namespace MontoyaTech.Rest.Net
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="routes"></param>
|
/// <param name="routes"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
protected virtual Dictionary<string, List<Route>> FindRouteGroups(List<Route> routes)
|
protected internal virtual Dictionary<string, List<Route>> FindRouteGroups(List<Route> routes)
|
||||||
{
|
{
|
||||||
var groups = new Dictionary<string, List<Route>>();
|
var groups = new Dictionary<string, List<Route>>();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user