public DatabasePage(MyEventHandler2 GoToMovieInsertPage, MyEventHandler GoToScheduleInsertPage, MyEventHandler GoToStatisticsPage)
 {
     InitializeComponent();
     this.GoToMovieInsertPage    = GoToMovieInsertPage;
     this.GoToScheduleInsertPage = GoToScheduleInsertPage;
     this.GoToStatisticsPage     = GoToStatisticsPage;
 }
示例#2
0
        public void FiresClosingLoadedEventsWithNewInstance()
        {
            var eventHandler = new MyEventHandler2();

            RecipeFactory.Loaded  += eventHandler.OnRecipeLoaded;
            RecipeFactory.Closing += eventHandler.OnRecipeClosing;
            RecipeFactory.NewRecipe(string.Empty);
            Assert.Equals("OnRecipeClosingOnRecipeLoaded", eventHandler.Events);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
 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);
 }
示例#6
0
 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);
 }
示例#7
0
 public void FiresClosingLoadedEventsWithNewInstance() {
    var eventHandler = new MyEventHandler2();
    RecipeFactory.Loaded += eventHandler.OnRecipeLoaded;
    RecipeFactory.Closing += eventHandler.OnRecipeClosing;
    RecipeFactory.NewRecipe(string.Empty);
    Assert.Equals("OnRecipeClosingOnRecipeLoaded", eventHandler.Events);
 }