diff --git a/gradebook/src/GradeBook/Book.cs b/gradebook/src/GradeBook/Book.cs index c4c438d..f5d95bc 100644 --- a/gradebook/src/GradeBook/Book.cs +++ b/gradebook/src/GradeBook/Book.cs @@ -19,7 +19,15 @@ namespace GradeBook } } - public abstract class Book : NamedObject + public interface IBook + { + void AddGrade(double grade); + Statistics GetStatistics(); + string Name { get; } + event GradeAddedDelegate GradeAdded; + } + + public abstract class Book : NamedObject, IBook { // Abstract class used to act as entrypoint for other class, so output // can change based on given input. At this level, we cannot provide implementation @@ -30,8 +38,14 @@ namespace GradeBook } public abstract void AddGrade(double grade); + + public virtual event GradeAddedDelegate GradeAdded; + public virtual Statistics GetStatistics() + { + throw new NotImplementedException(); + } } - public class InMemoryBook : Book + public class InMemoryBook : Book, IBook { private List grades; @@ -81,9 +95,9 @@ namespace GradeBook } } - public event GradeAddedDelegate GradeAdded; + public override event GradeAddedDelegate GradeAdded; - public Statistics GetStatistics() + public override Statistics GetStatistics() { var result = new Statistics(); result.Average = 0.0;