using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
public class StudentScore
public string Name {get;set;}
public int? Score {get;set;}
public class StudentGrader
public string Grade(StudentScore studentScore)
if(studentScore.Score > 90) return "A";
if(studentScore.Score > 80) return "B";
if(studentScore.Score > 70) return "C";
if(studentScore.Score > 60) return "D";
public class StudentScoreTests
Assert.Inconclusive("Not implemented");
public static void Main()
typeof(StudentScoreTests).GetMethods()
.Where(m => m.GetCustomAttribute<TestMethodAttribute>() != null);
foreach (var testMethod in testMethods)
var instance = new StudentScoreTests();
Console.Write($"{testMethod.Name}: ");
testMethod.Invoke(instance, null);
Console.WriteLine($"PASSED");
var message = ex.InnerException?.Message ?? ex.Message;
switch (ex.InnerException)
case AssertFailedException:
Console.WriteLine($"Failed - {message}");
case AssertInconclusiveException:
Console.WriteLine($"Inconclusive - {message}");
Console.WriteLine($"Exception - {message}");