public void LumberjackDefoggerLogging() { MockUserInterface mui = new MockUserInterface(); Lumberjack lumberjack = new Lumberjack(mui); mui.Lumberjack = lumberjack; lumberjack.Settings.Reset(); lumberjack.SetStartupLogFilterType(LogFilterType.NeverLog); lumberjack.Load(); Thread.Sleep(loadSleep); mui.ShowOpenFileDialogPath = Path.Combine(Lumberjack.GetConfigurationDirectory(), "Turbo Dynamics.profile"); mui.ShowOpenFileDialogResult = DialogResult.OK; lumberjack.ProfileOpen(); Thread.Sleep(actionSleep); bool cancel = false; lumberjack.Closing(ref cancel); Thread.Sleep(actionSleep); Assert.IsFalse(lumberjack.CurrentProfileIsChanged); string record = mui.ToString(); AssertRecordingStart(); AssertRecorded(ref record, "SetTitle"); AssertRecorded(ref record, "ShowNewProfileSettings"); AssertRecorded(ref record, "RenderLogEntry"); }
public void LumberjackLoadClose() { MockUserInterface mui = new MockUserInterface(); Lumberjack lumberjack = new Lumberjack(mui); mui.Lumberjack = lumberjack; lumberjack.Load(); Thread.Sleep(loadSleep); bool cancel = false; lumberjack.Closing(ref cancel); Thread.Sleep(actionSleep); string record = mui.ToString(); AssertRecordingStart(); AssertRecorded(ref record, "SetTitle"); }
public void LumberjackLoadNewClose() { MockUserInterface mui = new MockUserInterface(); Lumberjack lumberjack = new Lumberjack(mui); mui.Lumberjack = lumberjack; lumberjack.Load(); Thread.Sleep(loadSleep); lumberjack.ProfileNew(); Thread.Sleep(actionSleep); mui.Profile = LogProfile.CreateInstance(); mui.Profile.Add("P8", "rpm", lumberjack.Database); lumberjack.SelectedProfileSettingsChanged(); Thread.Sleep(actionSleep); bool cancel = false; lumberjack.Closing(ref cancel); Thread.Sleep(actionSleep); string record = mui.ToString(); AssertRecordingStart(); AssertRecorded(ref record, "SetTitle"); AssertRecorded(ref record, "ShowNewProfileSettings"); AssertRecorded(ref record, "SaveButtonEnabled: False"); AssertRecorded(ref record, "SetTitle: Lumberjack - Mock ECU - new profile"); //AssertRecorded(ref record, "RenderLogEntry"); AssertRecorded(ref record, "GetNewProfileSettings"); AssertRecorded(ref record, "SaveButtonEnabled: True"); AssertRecorded(ref record, "SetTitle: Lumberjack - Mock ECU - new profile*"); //AssertRecorded(ref record, "New Profile.profile"); //AssertRecorded(ref record, "Close"); Assert.Inconclusive("This test needs more work."); }