コード例 #1
0
        public void DisposeTest()
        {
            var _saveStatePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"SaveState\nhl94.zs3");
            var _statreader = new StatReader(_saveStatePath);

            var PSM = new PenaltySummaryManager(_statreader);
            var PSmodel = new PenaltySummaryModel();

            //Call Dispose
            PSM.Dispose();

            //Calling The GetPenaltySummary Method should fail as the FileStream Reader should be null.
            Exception ex = Assert.Throws<System.NullReferenceException>(() => PSmodel = PSM.GetPenaltySummary());

            //Verify The Expected Exception was thrown.
            Assert.Equal("Object reference not set to an instance of an object.", ex.Message);
        }
コード例 #2
0
 private void GetPenaltySummary()
 {
     var PSM = new PenaltySummaryManager(_statreader);
     var PSmodel = PSM.GetPenaltySummary();
     _boxscore.penaltysummary = PSmodel;
     PSM.Dispose();
 }