From 366349025e34f3a778a2f509fc1c4ca2d9f93232 Mon Sep 17 00:00:00 2001 From: antoineatstariongroup Date: Thu, 30 Jan 2025 10:09:52 +0100 Subject: [PATCH] Fix typos --- CDP4Dal/DAL/Credentials.cs | 4 ++-- CDP4Dal/Session.cs | 2 +- .../CdpServicesDalTestFixture.cs | 14 +++++++------- .../CdpServicesDalTestFixture.cs | 14 +++++++------- CDP4ServicesDal/CdpServicesDal.cs | 18 +++++++++--------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/CDP4Dal/DAL/Credentials.cs b/CDP4Dal/DAL/Credentials.cs index 5eae3e0d..72f511f8 100644 --- a/CDP4Dal/DAL/Credentials.cs +++ b/CDP4Dal/DAL/Credentials.cs @@ -179,10 +179,10 @@ public void ProvideUserToken(string token, AuthenticationSchemeKind authenticati /// /// Provides an asserts to assess that all informations are ready to be provided /// - public bool IsFullyInitiliazed => this.ComputeIsFullyInitialized(); + public bool IsFullyInitialized => this.ComputeIsFullyInitialized(); /// - /// Compute the property + /// Compute the property /// /// The asserts computated private bool ComputeIsFullyInitialized() diff --git a/CDP4Dal/Session.cs b/CDP4Dal/Session.cs index 62154021..174608ac 100644 --- a/CDP4Dal/Session.cs +++ b/CDP4Dal/Session.cs @@ -894,7 +894,7 @@ public async Task AuthenticateAndOpen(AuthenticationSchemeKind authenticationSch /// If all required informations are not provided public async Task RefreshAuthenticationInformation() { - if (this.Credentials.IsFullyInitiliazed) + if (this.Credentials.IsFullyInitialized) { throw new InvalidOperationException("Cannot refresh authentication information when credentials are fully initiliazed"); } diff --git a/CDP4ServicesDal.NetCore.Tests/CdpServicesDalTestFixture.cs b/CDP4ServicesDal.NetCore.Tests/CdpServicesDalTestFixture.cs index 3b0514de..8134afa0 100644 --- a/CDP4ServicesDal.NetCore.Tests/CdpServicesDalTestFixture.cs +++ b/CDP4ServicesDal.NetCore.Tests/CdpServicesDalTestFixture.cs @@ -871,11 +871,11 @@ public async Task VerifyWriteLongRunningTask() // To test this, please enable one by one authentication scheme on the CDP4 COMET Server public async Task VerifyCanAuthenticateWithMultipleSchemeAtDalLevel() { - var authentitcatioCredentials = new Credentials(new Uri("http://localhost:5000/")); + var authenticationCredentials = new Credentials(new Uri("http://localhost:5000/")); var servicesDal = new CdpServicesDal(); var cancellationSource = new CancellationTokenSource(); - servicesDal.InitializeDalCredentials(authentitcatioCredentials); + servicesDal.InitializeDalCredentials(authenticationCredentials); var availableScheme = (await servicesDal.RequestAvailableAuthenticationScheme(cancellationSource.Token)).Schemes.Single(); const string username = "admin"; const string password = "pass"; @@ -884,17 +884,17 @@ public async Task VerifyCanAuthenticateWithMultipleSchemeAtDalLevel() switch (availableScheme) { case AuthenticationSchemeKind.Basic: - authentitcatioCredentials.ProvideUserCredentials(username, password, availableScheme); + authenticationCredentials.ProvideUserCredentials(username, password, availableScheme); break; case AuthenticationSchemeKind.LocalJwtBearer: await servicesDal.Login(username, password, cancellationSource.Token); break; case AuthenticationSchemeKind.ExternalJwtBearer: - authentitcatioCredentials.ProvideUserToken(externalToken,availableScheme); + authenticationCredentials.ProvideUserToken(externalToken,availableScheme); break; } - var readThings = await servicesDal.Open(authentitcatioCredentials, cancellationSource.Token); + var readThings = await servicesDal.Open(authenticationCredentials, cancellationSource.Token); cancellationSource.Dispose(); Assert.That(readThings, Is.Not.Empty); @@ -906,8 +906,8 @@ public async Task VerifyCanAuthenticateWithMultipleSchemeAtDalLevel() // To test this, please enable one by one authentication scheme on the CDP4 COMET Server public async Task VerifyCanAuthenticateWithMultipleSchemeAtSessionLevel() { - var authentitcatioCredentials = new Credentials(new Uri("http://localhost:5000/")); - var authenticationSession = new Session(new CdpServicesDal(), authentitcatioCredentials, this.messageBus); + var authenticationCredentials = new Credentials(new Uri("http://localhost:5000/")); + var authenticationSession = new Session(new CdpServicesDal(), authenticationCredentials, this.messageBus); var availableScheme = (await authenticationSession.QueryAvailableAuthenticationScheme()).Schemes.Single(); diff --git a/CDP4ServicesDal.Tests/CdpServicesDalTestFixture.cs b/CDP4ServicesDal.Tests/CdpServicesDalTestFixture.cs index 822eb516..385253d7 100644 --- a/CDP4ServicesDal.Tests/CdpServicesDalTestFixture.cs +++ b/CDP4ServicesDal.Tests/CdpServicesDalTestFixture.cs @@ -906,11 +906,11 @@ public async Task VerifyWriteLongRunningTask() // To test this, please enable one by one authentication scheme on the CDP4 COMET Server public async Task VerifyCanAuthenticateWithMultipleSchemeAtDalLevel() { - var authentitcatioCredentials = new Credentials(new Uri("http://localhost:5000/")); + var authenticationCredentials = new Credentials(new Uri("http://localhost:5000/")); var servicesDal = new CdpServicesDal(); var cancellationSource = new CancellationTokenSource(); - servicesDal.InitializeDalCredentials(authentitcatioCredentials); + servicesDal.InitializeDalCredentials(authenticationCredentials); var availableScheme = (await servicesDal.RequestAvailableAuthenticationScheme(cancellationSource.Token)).Schemes.Single(); const string username = "admin"; const string password = "pass"; @@ -919,17 +919,17 @@ public async Task VerifyCanAuthenticateWithMultipleSchemeAtDalLevel() switch (availableScheme) { case AuthenticationSchemeKind.Basic: - authentitcatioCredentials.ProvideUserCredentials(username, password, availableScheme); + authenticationCredentials.ProvideUserCredentials(username, password, availableScheme); break; case AuthenticationSchemeKind.LocalJwtBearer: await servicesDal.Login(username, password, cancellationSource.Token); break; case AuthenticationSchemeKind.ExternalJwtBearer: - authentitcatioCredentials.ProvideUserToken(externalToken,availableScheme); + authenticationCredentials.ProvideUserToken(externalToken,availableScheme); break; } - var readThings = await servicesDal.Open(authentitcatioCredentials, cancellationSource.Token); + var readThings = await servicesDal.Open(authenticationCredentials, cancellationSource.Token); cancellationSource.Dispose(); Assert.That(readThings, Is.Not.Empty); @@ -941,8 +941,8 @@ public async Task VerifyCanAuthenticateWithMultipleSchemeAtDalLevel() // To test this, please enable one by one authentication scheme on the CDP4 COMET Server public async Task VerifyCanAuthenticateWithMultipleSchemeAtSessionLevel() { - var authentitcatioCredentials = new Credentials(new Uri("http://localhost:5000/")); - var authenticationSession = new Session(new CdpServicesDal(), authentitcatioCredentials, this.messageBus); + var authenticationCredentials = new Credentials(new Uri("http://localhost:5000/")); + var authenticationSession = new Session(new CdpServicesDal(), authenticationCredentials, this.messageBus); var availableScheme = (await authenticationSession.QueryAvailableAuthenticationScheme()).Schemes.Single(); diff --git a/CDP4ServicesDal/CdpServicesDal.cs b/CDP4ServicesDal/CdpServicesDal.cs index 34dfa304..59f74808 100644 --- a/CDP4ServicesDal/CdpServicesDal.cs +++ b/CDP4ServicesDal/CdpServicesDal.cs @@ -152,7 +152,7 @@ public override bool IsReadOnly /// public override async Task> Write(OperationContainer operationContainer, IEnumerable files = null) { - if (this.Credentials is not { IsFullyInitiliazed: true }) + if (this.Credentials is not { IsFullyInitialized: true }) { throw new InvalidOperationException("The CDP4 DAL is not open."); } @@ -286,7 +286,7 @@ private async Task ProcessWriteException(HttpResponseMessage httpResponseMessage /// If the provided is lower than 1 public override async Task Write(OperationContainer operationContainer, int waitTime, IEnumerable files = null) { - if (this.Credentials is not { IsFullyInitiliazed: true }) + if (this.Credentials is not { IsFullyInitialized: true }) { throw new InvalidOperationException("The CDP4 DAL is not open."); } @@ -459,7 +459,7 @@ public override async Task> Read(IEnumerable> Read(IEnumerablean await-able that returns a array. public override async Task ReadFile(Thing thing, CancellationToken cancellationToken) { - if (this.Credentials is not { IsFullyInitiliazed: true }) + if (this.Credentials is not { IsFullyInitialized: true }) { throw new InvalidOperationException("The CDP4 DAL is not open."); } @@ -611,7 +611,7 @@ public override async Task ReadFile(Thing thing, CancellationToken cance /// public override async Task> Read(T thing, CancellationToken cancellationToken, IQueryAttributes attributes = null) { - if (this.Credentials is not { IsFullyInitiliazed: true }) + if (this.Credentials is not { IsFullyInitialized: true }) { throw new InvalidOperationException("The CDP4 DAL is not open."); } @@ -887,9 +887,9 @@ public override async Task> Open(Credentials credentials, Can throw new ArgumentNullException(nameof(credentials.Uri), $"The Credentials URI may not be null"); } - if (!credentials.IsFullyInitiliazed) + if (!credentials.IsFullyInitialized) { - throw new ArgumentException("The Credentials is not be fully initiliazed"); + throw new ArgumentException("The Credentials is not be fully initialized"); } UriExtensions.AssertUriIsHttpOrHttpsSchema(credentials.Uri); @@ -988,7 +988,7 @@ public override void ApplyAuthenticationCredentials(Credentials credentials) throw new InvalidOperationException("Connection to datasource not established"); } - if (credentials is not { IsFullyInitiliazed: true }) + if (credentials is not { IsFullyInitialized: true }) { throw new InvalidOperationException("Credentials not fully initialized"); } @@ -1599,7 +1599,7 @@ private static void VerifyOperationContainerNotNull(OperationContainer operation /// A that contains the retrieved user shortname private async Task QueryAuthenticatedUserName(CancellationToken cancellationToken) { - if (this.Credentials is not { IsFullyInitiliazed: true }) + if (this.Credentials is not { IsFullyInitialized: true }) { throw new InvalidOperationException("Credentials are not fully initiliazed"); }