-
-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc: Refactor all files to use file-scoped namespaces
[skip ci]
- Loading branch information
1 parent
a1c9640
commit 67dd349
Showing
418 changed files
with
16,256 additions
and
16,639 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
39 changes: 19 additions & 20 deletions
39
ShopifySharp.Extensions.DependencyInjection.Tests/TestExtensions.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,28 +1,27 @@ | ||
namespace ShopifySharp.Extensions.DependencyInjection.Tests | ||
namespace ShopifySharp.Extensions.DependencyInjection.Tests; | ||
|
||
public static class ObjectExtensions | ||
{ | ||
public static class ObjectExtensions | ||
private static readonly Dictionary<ServiceLifetime, bool> ServiceLifetimeInstanceValidation = new() | ||
{ | ||
private static readonly Dictionary<ServiceLifetime, bool> ServiceLifetimeInstanceValidation = new() | ||
{ | ||
{ ServiceLifetime.Scoped, true }, | ||
{ ServiceLifetime.Singleton, true }, | ||
{ ServiceLifetime.Transient, false } | ||
}; | ||
{ ServiceLifetime.Scoped, true }, | ||
{ ServiceLifetime.Singleton, true }, | ||
{ ServiceLifetime.Transient, false } | ||
}; | ||
|
||
public static bool ValidLifetimeInstance(this object actual, object expceted, ServiceLifetime serviceLifetime) | ||
{ | ||
return ServiceLifetimeInstanceValidation.TryGetValue(serviceLifetime, out bool value) && value ? ReferenceEquals(actual, expceted) : !ReferenceEquals(actual, expceted); | ||
} | ||
public static bool ValidLifetimeInstance(this object actual, object expceted, ServiceLifetime serviceLifetime) | ||
{ | ||
return ServiceLifetimeInstanceValidation.TryGetValue(serviceLifetime, out bool value) && value ? ReferenceEquals(actual, expceted) : !ReferenceEquals(actual, expceted); | ||
} | ||
} | ||
|
||
public static class ServiceProviderExtensions | ||
public static class ServiceProviderExtensions | ||
{ | ||
public static TestServiceLifetime<T> GetServiceInstances<T>(this ServiceProvider? serviceProvider) where T : class | ||
{ | ||
public static TestServiceLifetime<T> GetServiceInstances<T>(this ServiceProvider? serviceProvider) where T : class | ||
{ | ||
var service1 = serviceProvider?.GetService<T>(); | ||
var service2 = serviceProvider?.GetService<T>(); | ||
var service1 = serviceProvider?.GetService<T>(); | ||
var service2 = serviceProvider?.GetService<T>(); | ||
|
||
return new TestServiceLifetime<T>(service1, service2); | ||
} | ||
return new TestServiceLifetime<T>(service1, service2); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System.Threading.Tasks; | ||
using System.Threading.Tasks; | ||
using Xunit; | ||
|
||
namespace ShopifySharp.Tests; | ||
|
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,4 +1,4 @@ | ||
using System; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
|
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,4 +1,4 @@ | ||
#nullable enable | ||
#nullable enable | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
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,4 +1,4 @@ | ||
using System; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Net; | ||
using System.Threading.Tasks; | ||
|
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,4 +1,4 @@ | ||
using System; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
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,4 +1,4 @@ | ||
using System.Linq; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Xunit; | ||
|
||
|
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,4 +1,4 @@ | ||
using System; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
using System; | ||
using System; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using ShopifySharp.Filters; | ||
|
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,4 +1,4 @@ | ||
using System.Linq; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using ShopifySharp.Filters; | ||
using Xunit; | ||
|
Oops, something went wrong.