Skip to content

Commit

Permalink
unit testing made correct
Browse files Browse the repository at this point in the history
  • Loading branch information
asif-khan17 authored and shreel2015 committed Sep 27, 2017
1 parent 7e743d0 commit 68072b9
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,10 @@ public async Task GetTotalMarksOfCodeSnippetQuestionAsyncTest()
Solution = answer.Code.Source,
Language = answer.Code.Language,
Score = 1,
CreatedDateTime = DateTime.UtcNow
};

await _trappistDbContext.TestCodeSolution.AddAsync(codeSolution1);
await _trappistDbContext.SaveChangesAsync();
var codeSolution2 = new TestCodeSolution()
{
Id = 2,
Expand All @@ -463,11 +464,9 @@ public async Task GetTotalMarksOfCodeSnippetQuestionAsyncTest()
Solution = answer.Code.Source,
Language = answer.Code.Language,
Score = 0,
CreatedDateTime = DateTime.UtcNow.AddDays(1)
};
list.Add(codeSolution1);
list.Add(codeSolution2);
await _trappistDbContext.TestCodeSolution.AddRangeAsync(list);
await Task.Delay(500);
await _trappistDbContext.TestCodeSolution.AddAsync(codeSolution2);
await _trappistDbContext.SaveChangesAsync();
var marksScoredInCodeSnippetQuestion = await _reportRepository.GetTotalMarksOfCodeSnippetQuestionAsync(testAttendee.Id, questionId);
var marksScoredWhenQuestionIdAbsent = await _reportRepository.GetTotalMarksOfCodeSnippetQuestionAsync(testAttendee.Id, 3);
Expand Down

0 comments on commit 68072b9

Please sign in to comment.