public DatabasePage(MyEventHandler2 GoToMovieInsertPage, MyEventHandler GoToScheduleInsertPage, MyEventHandler GoToStatisticsPage) { InitializeComponent(); this.GoToMovieInsertPage = GoToMovieInsertPage; this.GoToScheduleInsertPage = GoToScheduleInsertPage; this.GoToStatisticsPage = GoToStatisticsPage; }
public void FiresClosingLoadedEventsWithNewInstance() { var eventHandler = new MyEventHandler2(); RecipeFactory.Loaded += eventHandler.OnRecipeLoaded; RecipeFactory.Closing += eventHandler.OnRecipeClosing; RecipeFactory.NewRecipe(string.Empty); Assert.Equals("OnRecipeClosingOnRecipeLoaded", eventHandler.Events); }
public void RecipeCurrentIsUsefulForInvalidRecipePathName() { var eventHandler = new MyEventHandler2(); RecipeFactory.Loaded += eventHandler.OnRecipeLoaded; RecipeFactory.LoadFailed += eventHandler.OnRecipeLoadFailed; Assert.NotNull(RecipeFactory.Current); RecipeFactory.Load("invalid.recipe"); Assert.NotNull(RecipeFactory.Current); Assert.Equals("OnRecipeLoadFailed", eventHandler.Events); }
public void FiresClosingLoadedEventsWithLoad() { XmlDocumentFactory.Type = typeof(XmlDocumentMock); XmlDocumentMock.PathName = _absoluteRecipeFileName; XmlDocumentMock.RawContent = "<recipe></recipe>"; var eventHandler = new MyEventHandler2(); RecipeFactory.Loaded += eventHandler.OnRecipeLoaded; RecipeFactory.Closing += eventHandler.OnRecipeClosing; RecipeFactory.Load(_absoluteRecipeFileName); Assert.Equals("OnRecipeClosingOnRecipeLoaded", eventHandler.Events); }
public void RecipeCurrentIsUsefulForInvalidRecipePathName() { var eventHandler = new MyEventHandler2(); RecipeFactory.Loaded += eventHandler.OnRecipeLoaded; RecipeFactory.LoadFailed += eventHandler.OnRecipeLoadFailed; Assert.NotNull(RecipeFactory.Current); RecipeFactory.Load("invalid.recipe"); Assert.NotNull(RecipeFactory.Current); Assert.Equals("OnRecipeLoadFailed", eventHandler.Events); }
public void FiresClosingLoadedEventsWithLoad() { XmlDocumentFactory.Type = typeof(XmlDocumentMock); XmlDocumentMock.PathName = _absoluteRecipeFileName; XmlDocumentMock.RawContent = "<recipe></recipe>"; var eventHandler = new MyEventHandler2(); RecipeFactory.Loaded += eventHandler.OnRecipeLoaded; RecipeFactory.Closing += eventHandler.OnRecipeClosing; RecipeFactory.Load(_absoluteRecipeFileName); Assert.Equals("OnRecipeClosingOnRecipeLoaded", eventHandler.Events); }
public void FiresClosingLoadedEventsWithNewInstance() { var eventHandler = new MyEventHandler2(); RecipeFactory.Loaded += eventHandler.OnRecipeLoaded; RecipeFactory.Closing += eventHandler.OnRecipeClosing; RecipeFactory.NewRecipe(string.Empty); Assert.Equals("OnRecipeClosingOnRecipeLoaded", eventHandler.Events); }