-
Notifications
You must be signed in to change notification settings - Fork 22
Assignment 1 #19
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
base: Assignment1
Are you sure you want to change the base?
Assignment 1 #19
Changes from 7 commits
a59ac2f
6405f02
0903549
0024d32
8d49d27
3c4ff18
b728c81
1ec8dca
deb917e
ac8b0fe
a8d2e1b
3c0106b
1a8065d
6a134af
3148200
c40d23b
75e8527
8dffbfa
cdb3d52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -69,6 +69,21 @@ public void GetPercentCorrect_ReturnsExpectedPercentage(int numberOfCorrectGuess | |||||
Assert.AreEqual(expectedString, percentage); | ||||||
} | ||||||
|
||||||
[TestMethod] | ||||||
public async Task GenerateQuestions_SuccessfullyGeneratesQuestions() | ||||||
{ | ||||||
var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY"); | ||||||
Question q = await TriviaGenerator.GeneratePrincessBrideQuestionAsync(apiKey); | ||||||
Assert.IsNotNull(q); | ||||||
} | ||||||
|
||||||
[TestMethod] | ||||||
public async Task GenerateQuestions_GeneratesFourChoices() | ||||||
{ | ||||||
var apiKey = Environment.GetEnvironmentVariable("OPENAI_API_KEY"); | ||||||
Question q = await TriviaGenerator.GeneratePrincessBrideQuestionAsync(apiKey); | ||||||
Assert.HasCount(4, q.Answers); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Assert.HasCount is not a valid MSTest assertion method. Use Assert.AreEqual(4, q.Answers.Length) instead.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This may have been the standard previously, but with the MSTests that were provided which are more current than the old standards, this is no longer the case, and .HasCount is actually correct. |
||||||
} | ||||||
|
||||||
private static void GenerateQuestionsFile(string filePath, int numberOfQuestions) | ||||||
{ | ||||||
|
Uh oh!
There was an error while loading. Please reload this page.