Skip to content

Commit

Permalink
#127 - Ignore case options for library classes
Browse files Browse the repository at this point in the history
  • Loading branch information
matteobortolazzo committed Mar 18, 2021
1 parent d8dd418 commit 797dfaf
Show file tree
Hide file tree
Showing 25 changed files with 29 additions and 25 deletions.
6 changes: 5 additions & 1 deletion src/CouchDB.Driver/Helpers/CouchContractResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ internal CouchContractResolver(PropertyCaseType propertyCaseType)
JsonProperty property = base.CreateProperty(member, memberSerialization);
if (property != null && !property.Ignored)
{
property.PropertyName = member.GetCouchPropertyName(_propertyCaseType);
var declaringNamespace = member.DeclaringType?.Namespace;
if (declaringNamespace != null && !declaringNamespace.Contains("CouchDB.Driver"))
{
property.PropertyName = member.GetCouchPropertyName(_propertyCaseType);
}
}
return property;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/Attachments_Tests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using Flurl.Http.Testing;
using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/Authentication_Test.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System;
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using Flurl.Http.Testing;
using System.Collections.Generic;
using System.Linq;
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/Client_Tests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CouchDB.Driver.Exceptions;
using CouchDB.Driver.Types;
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using Flurl.Http.Testing;
using System;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Threading.Tasks;
using CouchDB.Driver.Extensions;
using CouchDB.Driver.Options;
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using Flurl.Http.Testing;
using Xunit;

Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/CouchDbContext_Tests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Threading.Tasks;
using CouchDB.Driver.Extensions;
using CouchDB.Driver.Options;
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using Flurl.Http.Testing;
using Xunit;

Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/Database_Tests.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using CouchDB.Driver.Security;
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using Flurl.Http.Testing;
using System;
using System.Collections.Generic;
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/Feed/GetChanges_Tests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CouchDB.Driver.DTOs;
using CouchDB.Driver.UnitTests._Helpers;
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using Flurl.Http.Testing;
using System;
using System.Net.Http;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CouchDB.Driver.DTOs;
using CouchDB.Driver.UnitTests._Helpers;
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using Flurl.Http.Testing;
using Newtonsoft.Json;
using System;
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/Find/Find_Discriminator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using System.Linq;
using Xunit;

Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/Find/Find_Miscellaneous.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using System;
using System.Linq;
using Xunit;
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/Find/Find_Selector.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using System;
using System.Linq;
using System.Linq.Expressions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using System;
using Xunit;
using System.Linq;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CouchDB.Driver.Extensions;
using CouchDB.Driver.Types;
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using System;
using System.Linq;
using CouchDB.Driver.Query.Extensions;
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/Find/Find_Sort.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using System;
using Xunit;
using System.Linq;
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/Index_Tests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Net.Http;
using System.Threading.Tasks;
using CouchDB.Driver.Indexes;
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using Flurl.Http.Testing;
using Xunit;

Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/Settings_Tests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using Flurl.Http.Testing;
using System;
using System.Collections.Generic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Linq;
using System.Threading.Tasks;
using CouchDB.Driver.Extensions;
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using Flurl.Http.Testing;
using Xunit;

Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/_Models/Battle.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;

namespace CouchDB.Driver.UnitTests.Models
namespace CouchDB.UnitTests.Models
{
public class Battle
{
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/_Models/NewRebel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace CouchDB.Driver.UnitTests.Models
namespace CouchDB.UnitTests.Models
{
public class NewRebel : Rebel
{
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/_Models/OtherRebel.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Newtonsoft.Json;
using System;

namespace CouchDB.Driver.UnitTests.Models
namespace CouchDB.UnitTests.Models
{
[JsonObject("custom_rebels")]
public class OtherRebel : Rebel
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/_Models/Rebel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System;
using System.Collections.Generic;

namespace CouchDB.Driver.UnitTests.Models
namespace CouchDB.UnitTests.Models
{
public class SimpleRebel : CouchDocument
{
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/_Models/RebelView.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using CouchDB.Driver.UnitTests.Models;
using CouchDB.UnitTests.Models;
using CouchDB.Driver.Views;

#nullable disable
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/_Models/Species.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace CouchDB.Driver.UnitTests.Models
namespace CouchDB.UnitTests.Models
{
public enum Species
{
Expand Down
2 changes: 1 addition & 1 deletion tests/CouchDB.Driver.UnitTests/_Models/Vehicle.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace CouchDB.Driver.UnitTests.Models
namespace CouchDB.UnitTests.Models
{
public class Vehicle
{
Expand Down

0 comments on commit 797dfaf

Please sign in to comment.