public void Cancel_should_reload_options() { SetUpOptionsController(new Settings()); optionsController.Cancel(); xmlSerializer.AssertWasCalled(xs => xs.LoadFromXml <Settings>(Arg <string> .Is.Anything), o => o.Repeat.Twice()); }
public void User_options_are_deserialised_if_the_file_exists() { const string projectLocation = "test.gallio"; var userOptionsLocation = projectLocation + UserOptions.Extension; fileSystem.Stub(fs => fs.FileExists(Arg <string> .Is.Anything)) .Return(true); xmlSerializer.Stub(xs => xs.LoadFromXml <UserOptions>(Arg <string> .Is.Anything)) .Return(new UserOptions()); controller.Handle(new ProjectLoaded(projectLocation)); xmlSerializer.AssertWasCalled(xs => xs.LoadFromXml <UserOptions>(userOptionsLocation)); }