Skip to content
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
5 changes: 0 additions & 5 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ on:
paths:
- "Dockerfile"
- "src/**"
pull_request:
branches: [ "main" ]
paths:
- "Dockerfile"
- "src/**"
workflow_dispatch:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion src/DevOpsQuickScan.BlazorApp/Components/Pages/Home.razor
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@
};
}

private void AnswerQuestion(QuestionAnsweredDto answer) =>
private void AnswerQuestion(QuestionAnswered answer) =>
Session.AnswerQuestion(_participantId!, answer.QuestionId, answer.AnswerId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

[Parameter] public required Question Question { get; set; }
[Parameter] public int? PreviousAnswer { get; set; }
[Parameter] public required EventCallback<QuestionAnsweredDto> OnQuestionAnswered { get; set; }
[Parameter] public required EventCallback<QuestionAnswered> OnQuestionAnswered { get; set; }

private int? _selectedAnswer;
private bool _hasSubmitted = false;
Expand All @@ -75,7 +75,7 @@

private async Task SubmitAnswer()
{
await OnQuestionAnswered.InvokeAsync(new QuestionAnsweredDto(Question.Id, _selectedAnswer!.Value));
await OnQuestionAnswered.InvokeAsync(new QuestionAnswered(Question.Id, _selectedAnswer!.Value));
_hasSubmitted = true;
}

Expand Down
3 changes: 3 additions & 0 deletions src/DevOpsQuickScan.Core/QuestionAnswered.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace DevOpsQuickScan.Core;

public record QuestionAnswered(int QuestionId, int AnswerId);
3 changes: 0 additions & 3 deletions src/DevOpsQuickScan.Core/QuestionAnsweredDto.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void RendersQuestionCorrectly()
parameters.Add(p => p.Question, question);
parameters.Add(p => p.PreviousAnswer, null);
parameters.Add(p => p.OnQuestionAnswered,
EventCallback.Factory.Create<QuestionAnsweredDto>(this, _ => { }));
EventCallback.Factory.Create<QuestionAnswered>(this, _ => { }));
});

// ASSERT
Expand Down Expand Up @@ -77,7 +77,7 @@ public void RenderingWithoutQuestionWillNotCrash()
parameters.Add(p => p.Question, null);
parameters.Add(p => p.PreviousAnswer, null);
parameters.Add(p => p.OnQuestionAnswered,
EventCallback.Factory.Create<QuestionAnsweredDto>(this, _ => { }));
EventCallback.Factory.Create<QuestionAnswered>(this, _ => { }));
});

// ASSERT
Expand Down Expand Up @@ -108,7 +108,7 @@ public void SelectingAnswerEnablesButton()
parameters.Add(p => p.Question, question);
parameters.Add(p => p.PreviousAnswer, null);
parameters.Add(p => p.OnQuestionAnswered,
EventCallback.Factory.Create<QuestionAnsweredDto>(this, _ => { }));
EventCallback.Factory.Create<QuestionAnswered>(this, _ => { }));
});

// ACT
Expand Down Expand Up @@ -138,14 +138,14 @@ public void CanSubmitAnswer()
]
};

QuestionAnsweredDto? answeredQuestion = null;
QuestionAnswered? answeredQuestion = null;

var component = RenderComponent<QuestionComponent>(parameters =>
{
parameters.Add(p => p.Question, question);
parameters.Add(p => p.PreviousAnswer, null);
parameters.Add(p => p.OnQuestionAnswered,
EventCallback.Factory.Create<QuestionAnsweredDto>(this, result => { answeredQuestion = result; }));
EventCallback.Factory.Create<QuestionAnswered>(this, result => { answeredQuestion = result; }));
});
var input = component.Find("input[value='3']");
var button = component.Find("button");
Expand Down Expand Up @@ -188,7 +188,7 @@ public void LoadingWithSelectionSelectsAnswerAndRemovesButton()
parameters.Add(p => p.Question, question);
parameters.Add(p => p.PreviousAnswer, 3);
parameters.Add(p => p.OnQuestionAnswered,
EventCallback.Factory.Create<QuestionAnsweredDto>(this, result => { }));
EventCallback.Factory.Create<QuestionAnswered>(this, result => { }));
});

// ASSERT
Expand Down
Loading