Created
December 4, 2018 12:18
-
-
Save safestudent/939a1aba631d98e19d611760283314c6 to your computer and use it in GitHub Desktop.
AverageActualPointsModelTest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void EmptyList() | |
{ | |
// ARRANGE | |
// Initialise the Statistics class | |
Statistics stats = new Statistics(); | |
// Set up 'in memory' database (can’t mock a context) | |
var options = new | |
DbContextOptionsBuilder<SprintTrackerWebContext>() | |
.UseInMemoryDatabase(databaseName: "Add_writes_to_database").Options; | |
// Create a context so we can talk to the empty database | |
var context = new SprintTrackerWebContext(options); | |
// ACT: get the average points from the sprints | |
var result = stats.GetAveragePoints(context); | |
// ASSERT: Test the result | |
Assert.Equal(0.0, result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment