mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-06 03:55:55 +00:00
Adding a convention test to detect whether a model has a constructor exposing all properties (#1798)
* Added a convention test to detect a model constructor exposing all properties * add ctors to classes where they are missing * rename ctor parameters that dont match properties * add missing parameters to existing ctors * add specific PunchCard ctor to allow mocking, and update test to resolve call ambiguity * Added base class properties to the convention test Added member exclusion attribute * Updated newly offending classes 2 excludes and 2 ctors * rename exclusion attribute to be a bit shorter
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reactive.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using NSubstitute;
|
||||
@@ -16,7 +17,7 @@ namespace Octokit.Tests.Reactive
|
||||
{
|
||||
var firstResponse = new TwoFactorRequiredException(TwoFactorType.AuthenticatorApp);
|
||||
var twoFactorChallengeResult = new TwoFactorChallengeResult("two-factor-code");
|
||||
var secondResponse = new ApplicationAuthorization("OAUTHSECRET");
|
||||
var secondResponse = new ApplicationAuthorization(0, null, null, null, null, null, null, null, DateTimeOffset.Now, DateTimeOffset.Now, null, "OAUTHSECRET");
|
||||
|
||||
var client = Substitute.For<IObservableAuthorizationsClient>();
|
||||
client.GetOrCreateApplicationAuthentication(Args.String, Args.String, Args.NewAuthorization)
|
||||
@@ -51,7 +52,7 @@ namespace Octokit.Tests.Reactive
|
||||
TwoFactorChallengeResult.RequestResendCode,
|
||||
new TwoFactorChallengeResult("two-factor-code")
|
||||
});
|
||||
var secondResponse = new ApplicationAuthorization("OAUTHSECRET");
|
||||
var secondResponse = new ApplicationAuthorization(0, null, null, null, null, null, null, null, DateTimeOffset.Now, DateTimeOffset.Now, null, "OAUTHSECRET");
|
||||
|
||||
var client = Substitute.For<IObservableAuthorizationsClient>();
|
||||
client.GetOrCreateApplicationAuthentication(Args.String, Args.String, Args.NewAuthorization)
|
||||
|
||||
Reference in New Issue
Block a user