Skip to content

Commit

Permalink
Merge pull request #42 from barrettcoats/master
Browse files Browse the repository at this point in the history
Fix Spelling In Tests And Interface
  • Loading branch information
EricJFisher committed Jan 15, 2019
2 parents 3322724 + 616fdc1 commit 86adae6
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions GradeBook/UserInterfaces/GradeBookUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static void AddStudentCommand(string command)
EnrollmentType enrollmentType;
if (!Enum.TryParse(parts[3], true, out enrollmentType))
{
Console.WriteLine("{0} is not a volid enrollment type, try again.", parts[3]);
Console.WriteLine("{0} is not a valid enrollment type, try again.", parts[3]);
return;
}

Expand Down Expand Up @@ -164,8 +164,8 @@ public static void HelpCommand()
Console.WriteLine("Honors - Students enrolled in Honors classes and not Dual Enrolled.");
Console.WriteLine("DualEnrolled - Students who are Duel Enrolled.");
Console.WriteLine();
Console.WriteLine("Accepted Enrollement Types:");
Console.WriteLine("Campus - Students who are in the same disctrict as the school.");
Console.WriteLine("Accepted Enrollment Types:");
Console.WriteLine("Campus - Students who are in the same district as the school.");
Console.WriteLine("State - Students who's legal residence is outside the school's district, but is in the same state as the school.");
Console.WriteLine("National - Students who's legal residence is not in the same state as the school, but is in the same country as the school.");
Console.WriteLine("International - Students who's legal residence is not in the same country as the school.");
Expand Down
4 changes: 2 additions & 2 deletions GradeBookTests/AddWeightedSupportToBaseGradeBook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ from type in assembly.GetTypes()
object gradeBook = Activator.CreateInstance(standardGradeBook, "WeightedTest", true);

// Assert that is weighted is true
Assert.True(gradeBook.GetType().GetProperty("IsWeighted").GetValue(gradeBook).ToString().ToLower() == "true", "`GradeBook.GradeBooks.BaseGradeBook`'s constructor didn't propertly set the `IsWeighted` property based on the provided bool parameter");
Assert.True(gradeBook.GetType().GetProperty("IsWeighted").GetValue(gradeBook).ToString().ToLower() == "true", "`GradeBook.GradeBooks.BaseGradeBook`'s constructor didn't properly set the `IsWeighted` property based on the provided bool parameter");
}

/// <summary>
/// All Tests related to the "Update StartingUserInterface CreateCommand Method's Condition"
/// </summary>
[Fact(DisplayName = "Update StartingUserInterface CreateCommand Methods Condition @add-weighted-to-createcommand")]
public void UpdateStartingUserInterefacesCreateCommandMethodsCondition()
public void UpdateStartingUserInterfacesCreateCommandMethodsCondition()
{
//Setup Test
var output = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace GradeBookTests
/// <summary>
/// This class contains all tests related to the "Create StandardGradeBook and RankedGradeBook Classes" task.
/// Note: Do not use these tests as example of good testing practices, due to the nature of how Pluralsight projects work
/// we have to create tests against code that doesn't exist and changes implimentation, due to this tests are fragile,
/// we have to create tests against code that doesn't exist and changes implementation, due to this tests are fragile,
/// hard to maintain, and don't don't adhere to the "test just one thing" practice commonly used in production tests.
/// </summary>
public class CreateStandardGradeBookandRankedGradeBookClassesTests
Expand All @@ -19,7 +19,7 @@ public class CreateStandardGradeBookandRankedGradeBookClassesTests
/// All Tests related to the "Create the StandardGradeBook Class" task.
/// </summary>
[Fact(DisplayName = "Create the StandardGradeBook Class @create-the-standardgradebook-class")]
public void StardardGradeBookExistsTest()
public void StandardGradeBookExistsTest()
{
// Get appropriate path to file for the current operating system
var filePath = ".." + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + ".." + Path.DirectorySeparatorChar + "GradeBook" + Path.DirectorySeparatorChar + "GradeBooks" + Path.DirectorySeparatorChar + "StandardGradeBook.cs";
Expand Down Expand Up @@ -58,7 +58,7 @@ from type in assembly.GetTypes()
var constructor = gradebook.GetConstructors().FirstOrDefault();

// Assert a constructor was found
Assert.True(constructor != null, "No constructor found for GradeBook.GradeBooks.StardardGradeBook.");
Assert.True(constructor != null, "No constructor found for GradeBook.GradeBooks.StandardGradeBook.");

// Get GradeBookType from the GradeBook.Enums namespace
var gradebookEnum = (from assembly in AppDomain.CurrentDomain.GetAssemblies()
Expand All @@ -74,7 +74,7 @@ from type in assembly.GetTypes()
if (parameters.Count() == 1 && parameters[0].ParameterType == typeof(string))
standardGradeBook = Activator.CreateInstance(gradebook, "LoadTest");

// GUARD CODE - Without this code this test will fail once the project is refactored to accomidate weighted grading DO NOT REMOVE!!!
// GUARD CODE - Without this code this test will fail once the project is refactored to accommodate weighted grading DO NOT REMOVE!!!
else if (parameters.Count() == 2 && parameters[0].ParameterType == typeof(string) && parameters[1].ParameterType == typeof(bool))
standardGradeBook = Activator.CreateInstance(gradebook, "LoadTest", true);
// END GUARD CODE
Expand Down Expand Up @@ -152,7 +152,7 @@ from type in assembly.GetTypes()
if (parameters.Count() == 1 && parameters[0].ParameterType == typeof(string))
rankedGradeBook = Activator.CreateInstance(gradebook, "LoadTest");

// GUARD CODE - Without this code this test will fail once the project is refactored to accomidate weighted grading DO NOT REMOVE!!!
// GUARD CODE - Without this code this test will fail once the project is refactored to accommodate weighted grading DO NOT REMOVE!!!
else if (parameters.Count() == 2 && parameters[0].ParameterType == typeof(string) && parameters[1].ParameterType == typeof(bool))
rankedGradeBook = Activator.CreateInstance(gradebook, "LoadTest", true);
// END GUARD CODE
Expand Down
8 changes: 4 additions & 4 deletions GradeBookTests/CreateStatisticsOverridesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ from type in assembly.GetTypes()
Assert.True(output.Contains("5 students") || output.Contains("five students"), "`GradeBook.GradeBooks.RankedGradeBook.CalculateStatistics` didn't respond with 'Ranked grading requires at least 5 students.' when there were less than 5 students.");

//Test that the base calculate statistics didn't still run when there were less than 5 students.
Assert.True(!output.Contains("average grade of all students is"), "`GradeBook.GradeBooks.RankedGradeBook.CalculateStastics` still ran the base `CalculateStatistics` when there was less than 5 students.");
Assert.True(!output.Contains("average grade of all students is"), "`GradeBook.GradeBooks.RankedGradeBook.CalculateStatistics` still ran the base `CalculateStatistics` when there was less than 5 students.");
}
}
finally
Expand Down Expand Up @@ -94,7 +94,7 @@ from type in assembly.GetTypes()
method.Invoke(gradeBook, null);
output = consolestream.ToString().ToLower();

Assert.True(output.Contains("average grade of all students is"), "`GradeBook.GradeBooks.RankedGradeBook.CalculateStastics` did not run the base `CalculateStatistics` when there was 5 or more students.");
Assert.True(output.Contains("average grade of all students is"), "`GradeBook.GradeBooks.RankedGradeBook.CalculateStatistics` did not run the base `CalculateStatistics` when there was 5 or more students.");
}
}
finally
Expand Down Expand Up @@ -154,7 +154,7 @@ from type in assembly.GetTypes()
Assert.True(output.Contains("5 students") || output.Contains("five students"), "`GradeBook.GradeBooks.RankedGradeBook.CalculateStudentStatistics` didn't respond with 'Ranked grading requires at least 5 students.' when there were less than 5 students.");

//Test that the base calculate statistics didn't still run when there were less than 5 students.
Assert.True(!output.Contains("grades:"), "`GradeBook.GradeBooks.RankedGradeBook.CalculateStudentStastics` still ran the base `CalculateStudentStatistics` when there was less than 5 students.");
Assert.True(!output.Contains("grades:"), "`GradeBook.GradeBooks.RankedGradeBook.CalculateStudentStatistics` still ran the base `CalculateStudentStatistics` when there was less than 5 students.");
}
}
finally
Expand Down Expand Up @@ -201,7 +201,7 @@ from type in assembly.GetTypes()
method.Invoke(gradeBook, new object[] { "jamie" });
output = consolestream.ToString().ToLower();

Assert.True(output.Contains("grades:"), "`GradeBook.GradeBooks.RankedGradeBook.CalculateStudentStastics` did not run the base `CalculateStudentStatistics` when there was 5 or more students.");
Assert.True(output.Contains("grades:"), "`GradeBook.GradeBooks.RankedGradeBook.CalculateStudentStatistics` did not run the base `CalculateStudentStatistics` when there was 5 or more students.");
}
}
finally
Expand Down
8 changes: 4 additions & 4 deletions GradeBookTests/OverrideRankedGradeBooksGetLetterGradeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ from type in assembly.GetTypes()
rgx = new Regex(pattern);
matches = rgx.Matches(input);

Assert.True(matches.Count == 0, "`RankedGradeBook.GetLetterGrade` is either not overiding `BaseGradeBook.GetLetterGrade` or is using `base.GetLetterGrade` within the override. If a higher grade isn't assigned `RankedGradeBook.GetLetterGrade` should return 'F'.");
Assert.True(matches.Count == 0, "`RankedGradeBook.GetLetterGrade` is either not overriding `BaseGradeBook.GetLetterGrade` or is using `base.GetLetterGrade` within the override. If a higher grade isn't assigned `RankedGradeBook.GetLetterGrade` should return 'F'.");
}
else
{
Assert.True(false, "`RankedGradeBook.GetLetterGrade` is either not overiding `BaseGradeBook.GetLetterGrade` or is using `base.GetLetterGrade` within the override.");
Assert.True(false, "`RankedGradeBook.GetLetterGrade` is either not overriding `BaseGradeBook.GetLetterGrade` or is using `base.GetLetterGrade` within the override.");
}
}

Expand Down Expand Up @@ -156,11 +156,11 @@ from type in assembly.GetTypes()
rgx = new Regex(pattern);
matches = rgx.Matches(input);

Assert.True(matches.Count == 0, "`RankedGradeBook.GetLetterGrade` is either not overiding `BaseGradeBook.GetLetterGrade` or is using `base.GetLetterGrade` within the override. If a higher grade isn't assigned `RankedGradeBook.GetLetterGrade` should return 'F'.");
Assert.True(matches.Count == 0, "`RankedGradeBook.GetLetterGrade` is either not overriding `BaseGradeBook.GetLetterGrade` or is using `base.GetLetterGrade` within the override. If a higher grade isn't assigned `RankedGradeBook.GetLetterGrade` should return 'F'.");
}
else
{
Assert.True(false, "`RankedGradeBook.GetLetterGrade` is either not overiding `BaseGradeBook.GetLetterGrade` or is using `base.GetLetterGrade` within the override.");
Assert.True(false, "`RankedGradeBook.GetLetterGrade` is either not overriding `BaseGradeBook.GetLetterGrade` or is using `base.GetLetterGrade` within the override.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace GradeBookTests
{
public class UpdateGPACalculationsToSupportWeightedGPATests
{
// <summary>
/// <summary>
/// All Tests related to the "Update BaseGradeBooks GetGPA Method" Task.
///</summary>
[Fact(DisplayName = "Update BaseGradeBooks GetGPA Method Test @update-basegradebook-s-getgpa-method")]
Expand All @@ -24,12 +24,12 @@ from type in assembly.GetTypes()
// Test if `StandardGradeBook` is `public`.
Assert.True(standardGradeBook.IsPublic, "`GradeBook.GradeBooks.StandardGradeBook` isn't public");

// Test if `StandardGradeBook` is inheritting `BaseGradeBook`.
// Test if `StandardGradeBook` is inheriting `BaseGradeBook`.
Assert.True(standardGradeBook.BaseType == typeof(BaseGradeBook), "`GradeBook.GradeBooks.StandardGradeBook` doesn't inherit `BaseGradeBook`");

// Test if `StandardGradeBook`'s constructor has the proper signature (consider both this task and later signature)
var ctor = standardGradeBook.GetConstructors().FirstOrDefault();
Assert.True(ctor != null, "No constructor found for GradeBook.GradeBooks.StardardGradeBook.");
Assert.True(ctor != null, "No constructor found for GradeBook.GradeBooks.StandardGradeBook.");

var parameters = ctor.GetParameters();
object gradeBook = null;
Expand Down

0 comments on commit 86adae6

Please sign in to comment.