From dcaaad8a65dd929b04a0d2131d597c569fa7b509 Mon Sep 17 00:00:00 2001 From: Viji Date: Wed, 24 Jul 2024 14:03:56 +0530 Subject: [PATCH] ut fix --- .../ArtifactoryValidatorTest.cs | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/src/AritfactoryUploader.UTest/ArtifactoryValidatorTest.cs b/src/AritfactoryUploader.UTest/ArtifactoryValidatorTest.cs index b8a0a7f2..4fbd5da8 100644 --- a/src/AritfactoryUploader.UTest/ArtifactoryValidatorTest.cs +++ b/src/AritfactoryUploader.UTest/ArtifactoryValidatorTest.cs @@ -55,33 +55,5 @@ public async Task ValidateArtifactoryCredentials_InputAppsettings_ReturnsIsvalid //Assert jfrogCommunicationMck.Verify(x => x.GetApiKey(), Times.AtLeastOnce); } - - [Test] - public void ValidateArtifactoryCredentials_InputAppsettings_ThrowsInvalidDataException() - { - //Arrange - JfrogKey jfrogKey = new JfrogKey() { ApiKey = "tyyteye" }; - HttpResponseMessage httpResponseMessage = new HttpResponseMessage(HttpStatusCode.Unauthorized) - { - Content = new ObjectContent(jfrogKey, new JsonMediaTypeFormatter(), "application/some-format") - }; - CommonAppSettings appSettings = new CommonAppSettings() - { - ArtifactoryUploadApiKey = "gegeg", - ArtifactoryUploadUser = "user@test.com" - }; - ArtifactoryCredentials artifactoryCredentials = new ArtifactoryCredentials() - { - ApiKey = "tyyteye", - Email = "user@test.com" - }; - Mock jfrogCommunicationMck = new Mock(UTParams.JFrogURL, "test", artifactoryCredentials, 100); - ArtifactoryValidator artifactoryValidator = new ArtifactoryValidator(jfrogCommunicationMck.Object); - jfrogCommunicationMck.Setup(x => x.GetApiKey()).ReturnsAsync(httpResponseMessage); - - // due to environment .exit the below method will not return anything , it wil break there - // assert will not pass al;ways - // Assert.ThrowsAsync(async () => await artifactoryValidator.ValidateArtifactoryCredentials(appSettings)) - } } }