Bumped package version to 1.4.5 and modified ClientGenerator to include System.Net assembly as a DotNet type.

This commit is contained in:
MattMo 2023-03-30 10:36:51 -07:00
parent 71941f5dd0
commit 4bc388d86b
3 changed files with 32 additions and 10 deletions

@ -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>
<RootNamespace>MontoyaTech.Rest.Net</RootNamespace>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<Version>1.4.4</Version>
<Version>1.4.5</Version>
<PackageReleaseNotes></PackageReleaseNotes>
<PackageIcon>Logo_Symbol_Black_Outline.png</PackageIcon>
</PropertyGroup>

@ -27,12 +27,11 @@ namespace MontoyaTech.Rest.Net
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
protected virtual bool IsTypeDotNet(Type type)
protected internal virtual bool IsTypeDotNet(Type type)
{
if (type.Assembly.GetName().Name == "System.Private.CoreLib")
return true;
var assemblyName = type.Assembly.GetName().Name;
return false;
return assemblyName == "System.Private.CoreLib" || assemblyName == "System.Net.Primitives";
}
/// <summary>
@ -40,7 +39,7 @@ namespace MontoyaTech.Rest.Net
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
protected virtual List<Type> FindTypeDependencies(Type type)
protected internal virtual List<Type> FindTypeDependencies(Type type)
{
var dependencies = new HashSet<Type>();
@ -116,7 +115,7 @@ namespace MontoyaTech.Rest.Net
/// </summary>
/// <param name="route"></param>
/// <returns></returns>
protected virtual List<Type> FindRouteDependencies(Route route)
protected internal virtual List<Type> FindRouteDependencies(Route route)
{
var dependencies = new HashSet<Type>();
@ -187,7 +186,7 @@ namespace MontoyaTech.Rest.Net
/// </summary>
/// <param name="routes"></param>
/// <returns></returns>
protected virtual List<Type> FindRoutesDependencies(List<Route> routes)
protected internal virtual List<Type> FindRoutesDependencies(List<Route> routes)
{
var dependencies = new HashSet<Type>();
@ -209,7 +208,7 @@ namespace MontoyaTech.Rest.Net
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
protected virtual string GetTypeFullyResolvedName(Type type)
protected internal virtual string GetTypeFullyResolvedName(Type type)
{
if (this.IsTypeDotNet(type))
{
@ -319,7 +318,7 @@ namespace MontoyaTech.Rest.Net
/// </summary>
/// <param name="routes"></param>
/// <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>>();