Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(NodeHasNotEdgesException):fix it #123

Merged
merged 2 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions AnalysisData/AnalysisData.sln.DotSettings.user
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/Environment/Highlighting/HighlightingSourceSnapshotLocation/@EntryValue">C:\Users\kimia\AppData\Local\JetBrains\Rider2024.1\resharper-host\temp\Rider\vAny\CoverageData\_AnalysisData.-35481945\Snapshot\snapshot.utdcvr</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=098e78e2_002D707b_002D4922_002D926d_002Dcb148189e0cf/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="CheckExistenceOfRole_ShouldTNothrowRoleNotFoundException_WhenRoleExist" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;Project Location="E:\CodeStar1403\Summer1403-Project-Group03-Backend\AnalysisData\TestProject" Presentation="&amp;lt;TestProject&amp;gt;" /&gt;&#xD;

<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=098e78e2_002D707b_002D4922_002D926d_002Dcb148189e0cf/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="CheckExistenceOfRole_ShouldTNothrowRoleNotFoundException_WhenRoleExist" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;Project Location="C:\Users\amir\Desktop\Mohaymen-final\Summer1403-Project-Group03-Backend\AnalysisData\TestProject" Presentation="&amp;lt;TestProject&amp;gt;" /&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=219940aa_002Df21c_002D44cf_002D9307_002Dab482de92a14/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="RoleRepositoryTests" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=219940aa_002Df21c_002D44cf_002D9307_002Dab482de92a14/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="RoleRepositoryTests" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;Project Location="C:\Users\Mahdi\Desktop\code star proje\Summer1403-Project-Group03-Backend\AnalysisData\TestProject" Presentation="&amp;lt;TestProject&amp;gt;" /&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=5a6db5c4_002D6b10_002D4bf8_002D8325_002D71b5cea4c333/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="UpdateCategory_ShouldReturnOk_WhenCategoryIsUpdatedSuccessfully" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;Project Location="C:\Users\Mahdi\Desktop\code star proje\Summer1403-Project-Group03-Backend\AnalysisData\TestProject" Presentation="&amp;lt;TestProject&amp;gt;" /&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=7500013c_002De743_002D474e_002Db412_002D6de4ada69526/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="GetEdgeAttributeValues_ShouldReturnEdgeInformationDtos_WhenEdgeAttributeValuesExist" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=7500013c_002De743_002D474e_002Db412_002D6de4ada69526/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="GetEdgeAttributeValues_ShouldReturnEdgeInformationDtos_WhenEdgeAttributeValuesExist" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;TestAncestor&gt;&#xD;
&lt;TestId&gt;xUnit::9AEC1F3F-B1B3-47C1-82D4-E432E2D77E0E::net8.0::GraphEdgeRepositoryTests&lt;/TestId&gt;&#xD;
&lt;TestId&gt;xUnit::9AEC1F3F-B1B3-47C1-82D4-E432E2D77E0E::net8.0::GraphNodeRepositoryTests&lt;/TestId&gt;&#xD;
Expand All @@ -18,8 +18,8 @@
&lt;TestId&gt;xUnit::9AEC1F3F-B1B3-47C1-82D4-E432E2D77E0E::net8.0::ValueNodeRepositoryTests&lt;/TestId&gt;&#xD;
&lt;/TestAncestor&gt;&#xD;
&lt;/SessionState&gt;</s:String>
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fe4fe44b_002D7953_002D4423_002Dac04_002Da7f1b464e5c0/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" Name="ResetPasswordAsync_ShouldCallPasswordCheck_WhenCalled" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;Project Location="E:\CodeStar1403\Summer1403-Project-Group03-Backend\AnalysisData\TestProject" Presentation="&amp;lt;TestProject&amp;gt;" /&gt;&#xD;
<s:String x:Key="/Default/Environment/UnitTesting/UnitTestSessionStore/Sessions/=fe4fe44b_002D7953_002D4423_002Dac04_002Da7f1b464e5c0/@EntryIndexedValue">&lt;SessionState ContinuousTestingMode="0" IsActive="True" Name="ResetPasswordAsync_ShouldCallPasswordCheck_WhenCalled" xmlns="urn:schemas-jetbrains-com:jetbrains-ut-session"&gt;&#xD;
&lt;Project Location="C:\Users\amir\Desktop\Mohaymen-final\Summer1403-Project-Group03-Backend\AnalysisData\TestProject" Presentation="&amp;lt;TestProject&amp;gt;" /&gt;&#xD;
&lt;/SessionState&gt;</s:String>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public GraphRelationService(IEntityNodeRepository entityNodeRepository, IEntityE
var role = claimsPrincipal.FindFirstValue(ClaimTypes.Role);
var username = claimsPrincipal.FindFirstValue("id");
var node = await _entityNodeRepository.GetByIdAsync(id);



(IEnumerable<NodeDto> nodes, IEnumerable<EdgeDto> edges) result;
var usernameGuid = Guid.Parse(username);

Expand All @@ -47,12 +48,7 @@ public GraphRelationService(IEntityNodeRepository entityNodeRepository, IEntityE
{
throw new NodeNotAccessibleForUserException();
}

if (!result.nodes.Any())
{
throw new NodeNotFoundException();
}


if (!result.edges.Any())
{
throw new NodeHasNotEdgesException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public async Task GetRelationalEdgeBaseNodeAsync_ShouldThrowNodeNotFoundExceptio
var action = async () => await _sut.GetRelationalEdgeBaseNodeAsync(claimsPrincipal, nodeId);

// Assert
await Assert.ThrowsAsync<NodeNotFoundException>(action);
await Assert.ThrowsAsync<NodeHasNotEdgesException>(action);
}

[Fact]
Expand Down
Loading