From 4dacab61e0ce62be60225f5648fa700bf6d487ad Mon Sep 17 00:00:00 2001 From: Malavika Date: Tue, 6 Aug 2024 14:12:35 +0530 Subject: [PATCH] added ut --- .../SW360ApicommunicationUTest.cs | 176 ++++++++++++++++- src/LCT.Services.UTest/JFrogServiceUTest.cs | 100 ++++++++++ .../Sw360ProjectServiceTest.cs | 103 +++++++--- src/LCT.Services.UTest/Sw360ServiceTest.cs | 178 +++++++++++++++++- 4 files changed, 528 insertions(+), 29 deletions(-) diff --git a/src/LCT.APICommunications.UTest/SW360ApicommunicationUTest.cs b/src/LCT.APICommunications.UTest/SW360ApicommunicationUTest.cs index d601dfb5..d853a20b 100644 --- a/src/LCT.APICommunications.UTest/SW360ApicommunicationUTest.cs +++ b/src/LCT.APICommunications.UTest/SW360ApicommunicationUTest.cs @@ -4,8 +4,12 @@ // SPDX-License-Identifier: MIT // -------------------------------------------------------------------------------------------------------------------- +using LCT.APICommunications.Model; using LCT.Common.Model; +using Moq.Protected; +using Moq; using Newtonsoft.Json; +using System.Net; using System.Text; namespace LCT.APICommunications.UTest @@ -148,12 +152,182 @@ public void SW360Apicommunication_UpdateComponent_ReturnsInvalidOperationExcepti HttpContent httpContent; var jsonString = JsonConvert.SerializeObject(""); httpContent = new StringContent(jsonString, Encoding.UTF8, "application/json"); - + //Arrange SW360Apicommunication sW360Apicommunication = new SW360Apicommunication(connectionSettings); //Assert Assert.ThrowsAsync(async () => await sW360Apicommunication.UpdateComponent("", httpContent)); } + [Test] + public async Task GetComponentByName_ReturnsExpectedString_WhenResponseIsOk() + { + // Arrange + var mockHttpMessageHandler = new Mock(); + mockHttpMessageHandler.Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent("Test content"), + }); + + var httpClient = new HttpClient(mockHttpMessageHandler.Object); + var sW360Apicommunication = new SW360Apicommunication(connectionSettings); + + + + // Act + Assert.ThrowsAsync(async () => await sW360Apicommunication.GetComponentByName("TestComponentName")); + + } + [Test] + public async Task UpdateRelease_ReturnsHttpResponseMessage_WhenResponseIsOk() + { + // Arrange + var mockHttpMessageHandler = new Mock(); + mockHttpMessageHandler.Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + }); + + var httpClient = new HttpClient(mockHttpMessageHandler.Object); + var sW360Apicommunication = new SW360Apicommunication(connectionSettings); + + + var httpContent = new StringContent("Test content", Encoding.UTF8, "application/json"); + + // Act + Assert.ThrowsAsync(async () => await sW360Apicommunication.UpdateRelease("TestReleaseId", httpContent)); + + + } + [Test] + public async Task CreateComponent_ReturnsHttpResponseMessage_WhenCalledWithCreateComponentContent() + { + // Arrange + var mockHttpMessageHandler = new Mock(); + mockHttpMessageHandler.Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + }); + + var httpClient = new HttpClient(mockHttpMessageHandler.Object); + var sW360Apicommunication = new SW360Apicommunication(connectionSettings); + + var createComponentContent = new CreateComponent(); + + // Act + Assert.ThrowsAsync(async () => await sW360Apicommunication.CreateComponent(createComponentContent)); + + + } + [Test] + public async Task GetComponentByExternalId_ReturnsHttpResponseMessage_WhenResponseIsOk() + { + // Arrange + var mockHttpMessageHandler = new Mock(); + mockHttpMessageHandler.Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent("Test content"), + }); + + var httpClient = new HttpClient(mockHttpMessageHandler.Object); + var sW360Apicommunication = new SW360Apicommunication(connectionSettings); + Assert.ThrowsAsync(async () => await sW360Apicommunication.GetComponentByExternalId("TestPurlId")); + + + } + [Test] + public async Task GetProjects_ReturnsContent_WhenResponseIsOk() + { + // Arrange + var mockHttpMessageHandler = new Mock(); + mockHttpMessageHandler.Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent("Test content"), + }); + + var httpClient = new HttpClient(mockHttpMessageHandler.Object); + var sW360Apicommunication = new SW360Apicommunication(connectionSettings); + // Act + Assert.ThrowsAsync(async () => await sW360Apicommunication.GetProjects()); + + + } + [Test] + public async Task GetComponentByName_ReturnsContent_WhenCalledWithComponentName() + { + // Arrange + var mockHttpMessageHandler = new Mock(); + mockHttpMessageHandler.Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent("Test content"), + }); + + var httpClient = new HttpClient(mockHttpMessageHandler.Object); + var sW360Apicommunication = new SW360Apicommunication(connectionSettings); + + + // Act + Assert.ThrowsAsync(async () => await sW360Apicommunication.GetComponentByName("TestComponent")); + + } + [Test] + public async Task GetReleases_ReturnsContent_WhenResponseIsOk() + { + // Arrange + var mockHttpMessageHandler = new Mock(); + mockHttpMessageHandler.Protected() + .Setup>( + "SendAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .ReturnsAsync(new HttpResponseMessage + { + StatusCode = HttpStatusCode.OK, + Content = new StringContent("Test content"), + }); + + var httpClient = new HttpClient(mockHttpMessageHandler.Object); + var sW360Apicommunication = new SW360Apicommunication(connectionSettings); + + // Act + Assert.ThrowsAsync(async () => await sW360Apicommunication.GetReleases()); + + + } + } } diff --git a/src/LCT.Services.UTest/JFrogServiceUTest.cs b/src/LCT.Services.UTest/JFrogServiceUTest.cs index 2c3eb662..5d3793ca 100644 --- a/src/LCT.Services.UTest/JFrogServiceUTest.cs +++ b/src/LCT.Services.UTest/JFrogServiceUTest.cs @@ -230,5 +230,105 @@ public async Task GetPackageInfo_ResultsWith_HttpRequestException() // Assert Assert.Null(actual); } + [Test] + public async Task GetInternalComponentDataByRepo_ResultsWith_NullHttpResponse() + { + // Arrange + HttpResponseMessage httpResponseMessage = null; + + var mockJfrogApiComFacade = new Mock(); + mockJfrogApiComFacade + .Setup(x => x.GetInternalComponentDataByRepo(It.IsAny())) + .ReturnsAsync(httpResponseMessage); + + // Act + IJFrogService jFrogService = new JFrogService(mockJfrogApiComFacade.Object); + IList actual = await jFrogService.GetInternalComponentDataByRepo("energy-dev-npm-egll"); + + // Assert + Assert.That(actual.Count, Is.EqualTo(0)); + } + + [Test] + public async Task GetInternalComponentDataByRepo_ResultsWith_NullHttpResponseContent() + { + // Arrange + HttpResponseMessage httpResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = null + }; + + var mockJfrogApiComFacade = new Mock(); + mockJfrogApiComFacade + .Setup(x => x.GetInternalComponentDataByRepo(It.IsAny())) + .ReturnsAsync(httpResponseMessage); + + // Act + IJFrogService jFrogService = new JFrogService(mockJfrogApiComFacade.Object); + IList actual = await jFrogService.GetInternalComponentDataByRepo("energy-dev-npm-egll"); + + // Assert + Assert.That(actual.Count, Is.EqualTo(0)); + } + [Test] + public async Task CheckJFrogConnectivity_SuccessfulConnection_ReturnsHttpResponseMessage() + { + // Arrange + HttpResponseMessage httpResponseMessage = new HttpResponseMessage(HttpStatusCode.OK); + Mock mockJfrogApiComFacade = new Mock(); + mockJfrogApiComFacade + .Setup(x => x.CheckConnection()) + .ReturnsAsync(httpResponseMessage); + + // Act + IJFrogService jFrogService = new JFrogService(mockJfrogApiComFacade.Object); + HttpResponseMessage actual = await jFrogService.CheckJFrogConnectivity(); + + // Assert + Assert.NotNull(actual); + Assert.AreEqual(HttpStatusCode.OK, actual.StatusCode); + } + + [Test] + public async Task CheckJFrogConnectivity_UnsuccessfulConnection_ReturnsHttpResponseMessage() + { + // Arrange + HttpResponseMessage httpResponseMessage = new HttpResponseMessage(HttpStatusCode.BadRequest); + Mock mockJfrogApiComFacade = new Mock(); + mockJfrogApiComFacade + .Setup(x => x.CheckConnection()) + .ReturnsAsync(httpResponseMessage); + + // Act + IJFrogService jFrogService = new JFrogService(mockJfrogApiComFacade.Object); + HttpResponseMessage actual = await jFrogService.CheckJFrogConnectivity(); + + // Assert + Assert.NotNull(actual); + Assert.AreEqual(HttpStatusCode.BadRequest, actual.StatusCode); + } + + [Test] + public async Task GetInternalComponentDataByRepo_ShouldReturnEmptyList_WhenHttpResponseContentIsNull() + { + // Arrange + HttpResponseMessage httpResponseMessage = new HttpResponseMessage(HttpStatusCode.OK) + { + Content = null + }; + + Mock mockJfrogApiComFacade = new Mock(); + mockJfrogApiComFacade + .Setup(x => x.GetInternalComponentDataByRepo(It.IsAny())) + .ReturnsAsync(httpResponseMessage); + + // Act + IJFrogService jFrogService = new JFrogService(mockJfrogApiComFacade.Object); + IList actual = await jFrogService.GetInternalComponentDataByRepo("energy-dev-npm-egll"); + + // Assert + Assert.That(actual.Count, Is.EqualTo(0)); + } + } } diff --git a/src/LCT.Services.UTest/Sw360ProjectServiceTest.cs b/src/LCT.Services.UTest/Sw360ProjectServiceTest.cs index d81d4df6..4516d82f 100644 --- a/src/LCT.Services.UTest/Sw360ProjectServiceTest.cs +++ b/src/LCT.Services.UTest/Sw360ProjectServiceTest.cs @@ -174,40 +174,89 @@ public async Task GetProjectLinkedReleasesByProjectId_ValidProjectId_ReturnsRele // Assert Assert.That(actual.Count, Is.EqualTo(expected.Count), "GetProjectLinkedReleasesByProjectId does not return empty on exception"); - } + } - [Test] - public async Task GetAlreadyLinkedReleasesByProjectId_PassProjectId_SuccessFullyReturnsReleaseLinked() - { - // Arrange - Self self = new Self() { Href = "http://md2pdvnc:8095/resource/api/releases/ff8d19674e737371be578cafec0c663e" }; - Links links = new Links() { Self = self }; + [Test] + public async Task GetAlreadyLinkedReleasesByProjectId_PassProjectId_SuccessFullyReturnsReleaseLinked() + { + // Arrange + Self self = new Self() { Href = "http://md2pdvnc:8095/resource/api/releases/ff8d19674e737371be578cafec0c663e" }; + Links links = new Links() { Self = self }; + + Sw360Releases sw360Releases = new Sw360Releases() { Name = "tslib", Version = "2.2.0", Links = links }; + Sw360LinkedRelease sw360LinkedRelease = new Sw360LinkedRelease(); + sw360LinkedRelease.Release = "http://md2pdvnc:8095/resource/api/releases/ff8d19674e737371be578cafec0c663e"; + List sw360LinkedReleases = new List(); + sw360LinkedReleases.Add(sw360LinkedRelease); + ProjectReleases projectReleases = new ProjectReleases(); + projectReleases.Embedded = + new ReleaseEmbedded() { Sw360Releases = new List() { sw360Releases } }; + projectReleases.LinkedReleases = sw360LinkedReleases; + + + List expected = new List(); + HttpResponseMessage httpResponseMessage = new HttpResponseMessage(System.Net.HttpStatusCode.OK); + httpResponseMessage.Content = new ObjectContent(projectReleases, new JsonMediaTypeFormatter(), "application/some-format"); + + Mock sW360ApicommunicationFacadeMck = new Mock(); + sW360ApicommunicationFacadeMck.Setup(x => x.GetProjectById(It.IsAny())).ReturnsAsync(httpResponseMessage); + ISw360ProjectService sw360ProjectService = new Sw360ProjectService(sW360ApicommunicationFacadeMck.Object); + + // Act + List actual = await sw360ProjectService.GetAlreadyLinkedReleasesByProjectId("shdjdkhsdfdkfhdhifsodo"); + + + // Assert + Assert.That(actual.Count, Is.GreaterThan(0)); + } + [Test] + public async Task GetAlreadyLinkedReleasesByProjectId_HttpRequestExceptionThrown_ReturnsEmptyList() + { + // Arrange + Mock _sw360ApicommunicationFacadeMock = new Mock(); - Sw360Releases sw360Releases = new Sw360Releases() { Name = "tslib", Version = "2.2.0", Links = links }; - Sw360LinkedRelease sw360LinkedRelease = new Sw360LinkedRelease(); - sw360LinkedRelease.Release = "http://md2pdvnc:8095/resource/api/releases/ff8d19674e737371be578cafec0c663e"; - List sw360LinkedReleases = new List(); - sw360LinkedReleases.Add(sw360LinkedRelease); - ProjectReleases projectReleases = new ProjectReleases(); - projectReleases.Embedded = - new ReleaseEmbedded() { Sw360Releases = new List() { sw360Releases } }; - projectReleases.LinkedReleases = sw360LinkedReleases; + _sw360ApicommunicationFacadeMock.Setup(x => x.GetProjectById(It.IsAny())).ThrowsAsync(new HttpRequestException("Request failed")); + ISw360ProjectService sw360ProjectService = new Sw360ProjectService(_sw360ApicommunicationFacadeMock.Object); + // Act + List actual = await sw360ProjectService.GetAlreadyLinkedReleasesByProjectId("projectId"); - List expected = new List(); - HttpResponseMessage httpResponseMessage = new HttpResponseMessage(System.Net.HttpStatusCode.OK); - httpResponseMessage.Content = new ObjectContent(projectReleases, new JsonMediaTypeFormatter(), "application/some-format"); + // Assert + Assert.That(actual, Is.Empty, "GetAlreadyLinkedReleasesByProjectId does not return empty on HttpRequestException"); + } - Mock sW360ApicommunicationFacadeMck = new Mock(); - sW360ApicommunicationFacadeMck.Setup(x => x.GetProjectById(It.IsAny())).ReturnsAsync(httpResponseMessage); - ISw360ProjectService sw360ProjectService = new Sw360ProjectService(sW360ApicommunicationFacadeMck.Object); + [Test] + public async Task GetAlreadyLinkedReleasesByProjectId_AggregateExceptionThrown_ReturnsEmptyList() + { + // Arrange + Mock _sw360ApicommunicationFacadeMock = new Mock(); - // Act - List actual = await sw360ProjectService.GetAlreadyLinkedReleasesByProjectId("shdjdkhsdfdkfhdhifsodo"); + _sw360ApicommunicationFacadeMock.Setup(x => x.GetProjectById(It.IsAny())).ThrowsAsync(new AggregateException("Aggregate exception")); + ISw360ProjectService sw360ProjectService = new Sw360ProjectService(_sw360ApicommunicationFacadeMock.Object); + // Act + List actual = await sw360ProjectService.GetAlreadyLinkedReleasesByProjectId("projectId"); - // Assert - Assert.That(actual.Count, Is.GreaterThan(0)); + // Assert + Assert.That(actual, Is.Empty, "GetAlreadyLinkedReleasesByProjectId does not return empty on AggregateException"); + } + + [Test] + public async Task GetAlreadyLinkedReleasesByProjectId_StatusNotOk_ReturnsEmptyList() + { + // Arrange + HttpResponseMessage response = new HttpResponseMessage(System.Net.HttpStatusCode.BadRequest); + Mock _sw360ApicommunicationFacadeMock = new Mock(); + + _sw360ApicommunicationFacadeMock.Setup(x => x.GetProjectById(It.IsAny())).ReturnsAsync(response); + + // Act + ISw360ProjectService sw360ProjectService = new Sw360ProjectService(_sw360ApicommunicationFacadeMock.Object); + + List actual = await sw360ProjectService.GetAlreadyLinkedReleasesByProjectId("projectId"); + + // Assert + Assert.That(actual, Is.Empty, "GetAlreadyLinkedReleasesByProjectId does not return empty on BadRequest status code"); + } } - } } diff --git a/src/LCT.Services.UTest/Sw360ServiceTest.cs b/src/LCT.Services.UTest/Sw360ServiceTest.cs index 39e34c1a..ab28bb90 100644 --- a/src/LCT.Services.UTest/Sw360ServiceTest.cs +++ b/src/LCT.Services.UTest/Sw360ServiceTest.cs @@ -24,7 +24,9 @@ namespace LCT.Services.UTest [TestFixture] internal class Sw360ServiceTest { - + private Mock _mockSW360ApiCommunicationFacade; + private Sw360Service _sw360Service; + private Mock _mockFacade; [Test] public async Task GetProjectNameByProjectIDFromSW360_ProvidedProjectIdReturnsProjectName() { @@ -465,5 +467,179 @@ public async Task GetAttachmentDownloadLink_ForGivenReleaseURL_ReturnsEmptyObjOn // Assert Assert.That(actual.AttachmentLink, Is.Null); } + [Test] + public async Task GetComponentReleaseID_Success() + { + // Arrange + string componentName = "ComponentName"; + string version = "1.0"; + string mockApiResponse = "{\"_embedded\":{\"sw360:releases\":[{\"name\":\"ComponentName\",\"version\":\"1.0\",\"_links\":{\"self\":{\"href\":\"http://example.com/release/123\"}}}]}}"; + + Mock swApiCommunicationFacade = new Mock(); + swApiCommunicationFacade.Setup(x => x.GetReleaseByCompoenentName(componentName)).ReturnsAsync(mockApiResponse); + + ISW360Service sW360Service = new Sw360Service(swApiCommunicationFacade.Object); + + // Act + string releaseId = await sW360Service.GetComponentReleaseID(componentName, version); + + // Assert + Assert.AreEqual("123", releaseId); + } + + [Test] + public async Task GetComponentReleaseID_HttpRequestException_ReturnsEmptyString() + { + // Arrange + string componentName = "ComponentName"; + string version = "1.0"; + + Mock swApiCommunicationFacade = new Mock(); + swApiCommunicationFacade.Setup(x => x.GetReleaseByCompoenentName(componentName)).ThrowsAsync(new HttpRequestException()); + + ISW360Service sW360Service = new Sw360Service(swApiCommunicationFacade.Object); + + // Act + string releaseId = await sW360Service.GetComponentReleaseID(componentName, version); + + // Assert + Assert.AreEqual("", releaseId); + } + [Test] + public async Task GetReleaseInfoByReleaseId_ForInvalidReleaseLink_ReturnsNotFoundStatusCode() + { + // Arrange + string releaseId = "http://localhost:8090/resource/api/releases/invalidReleaseId"; + Mock swApiCommunicationFacade = new Mock(); + HttpResponseMessage httpResponse = new HttpResponseMessage(HttpStatusCode.NotFound); + swApiCommunicationFacade.Setup(x => x.GetReleaseById(It.IsAny())).ReturnsAsync(httpResponse); + + // Act + ISW360Service sW360Service = new Sw360Service(swApiCommunicationFacade.Object); + HttpResponseMessage responseMessage = await sW360Service.GetReleaseInfoByReleaseId(releaseId); + + // Assert + Assert.AreEqual(HttpStatusCode.NotFound, responseMessage.StatusCode); + } + [Test] + public async Task GetComponentReleaseID_ShouldReturnReleaseId_WhenComponentExists() + { + // Arrange + string componentName = "TestComponent"; + string version = "1.0"; + string response = @"{ + ""_embedded"": { + ""sw360Releases"": [ + { + ""name"": ""TestComponent"", + ""version"": ""1.0"", + ""links"": { + ""self"": { + ""href"": ""/releases/123"" + } + } + } + ] + } + }"; + _mockSW360ApiCommunicationFacade.Setup(x => x.GetReleaseByCompoenentName(componentName)).ReturnsAsync(response); + + // Act + string releaseId = await _sw360Service.GetComponentReleaseID(componentName, version); + + // Assert + Assert.AreEqual("123", releaseId); + } + + [Test] + public async Task GetComponentReleaseID_ShouldReturnEmptyString_WhenComponentDoesNotExist() + { + // Arrange + string componentName = "TestComponent"; + string version = "1.0"; + string response = @"{ + ""_embedded"": { + ""sw360Releases"": [] + } + }"; + _mockSW360ApiCommunicationFacade.Setup(x => x.GetReleaseByCompoenentName(componentName)).ReturnsAsync(response); + + // Act + string releaseId = await _sw360Service.GetComponentReleaseID(componentName, version); + + // Assert + Assert.AreEqual("", releaseId); + } + + [Test] + public async Task GetComponentReleaseID_ShouldReturnEmptyString_WhenHttpRequestFails() + { + // Arrange + string componentName = "TestComponent"; + string version = "1.0"; + _mockSW360ApiCommunicationFacade.Setup(x => x.GetReleaseByCompoenentName(componentName)).ThrowsAsync(new HttpRequestException()); + + // Act + string releaseId = await _sw360Service.GetComponentReleaseID(componentName, version); + + // Assert + Assert.AreEqual("", releaseId); + } + [Test] + public async Task GetAttachmentDownloadLink_WhenReleaseAttachmentUrlIsNullOrWhiteSpace_ReturnsEmptyAttachmentHash() + { + // Arrange + string releaseAttachmentUrl = ""; + + // Act + var result = await _sw360Service.GetAttachmentDownloadLink(releaseAttachmentUrl); + + // Assert + Assert.IsNotNull(result); + Assert.AreEqual("", result.AttachmentLink); + Assert.AreEqual("", result.SourceDownloadUrl); + Assert.IsTrue(result.isAttachmentSourcenotAvailableInSw360); + } + + [Test] + public async Task GetAttachmentDownloadLink_WhenReleaseAttachmentUrlThrowsHttpRequestException_ReturnsEmptyAttachmentHash() + { + // Arrange + string releaseAttachmentUrl = "https://example.com/release/attachments"; + + _mockSW360ApiCommunicationFacade.Setup(x => x.GetReleaseAttachments(releaseAttachmentUrl)) + .ThrowsAsync(new HttpRequestException()); + + // Act + var result = await _sw360Service.GetAttachmentDownloadLink(releaseAttachmentUrl); + + // Assert + Assert.IsNotNull(result); + Assert.AreEqual("", result.AttachmentLink); + Assert.AreEqual("", result.SourceDownloadUrl); + Assert.IsTrue(result.isAttachmentSourcenotAvailableInSw360); + } + [Test] + public async Task GetAttachmentDownloadLink_WhenReleaseAttachmentUrlThrowsAggregateException_ReturnsEmptyAttachmentHash() + { + // Arrange + string releaseAttachmentUrl = "https://example.com/release/attachments"; + + _mockSW360ApiCommunicationFacade.Setup(x => x.GetReleaseAttachments(releaseAttachmentUrl)) + .ThrowsAsync(new AggregateException()); + + // Act + var result = await _sw360Service.GetAttachmentDownloadLink(releaseAttachmentUrl); + + // Assert + Assert.IsNotNull(result); + if (result != null) + { + Assert.AreEqual("", result.AttachmentLink ?? ""); // Handle null property + Assert.AreEqual("", result.SourceDownloadUrl ?? ""); // Handle null property + Assert.IsTrue(result.isAttachmentSourcenotAvailableInSw360); + } + } + } }