public void Should_return_settings_from_project_file_if_valid_JSON() { using (var testable = new GetSettingsTestable()) { testable.WriteSettings(@"{ ""output"": ""Warning"" }"); try { var actual = testable.Instance.LoadSettings(testable.Project); I.Expect(actual).Not.ToBeNull(); I.Expect(actual.Output).ToBe(Output.Warning); } finally { testable.DeleteSettings(); } } }
public void Spec01() { using (var testable = new GetSettingsTestable()) { testable.WriteSettings(@"{ ""output"": ""Warning"" }"); try { var actual = testable.Instance.LoadSettings(testable.Project); I.Expect(actual).Not.ToBeNull(); I.Expect(actual.Output).ToBe(Output.Warning); } finally { testable.DeleteSettings(); } } }
public void Should_return_default_instance_from_project_file_if_invalid_JSON() { using (var testable = new GetSettingsTestable()) { testable.WriteSettings(@"<NOT>JSON</NOT>"); try { var actual = testable.Instance.LoadSettings(testable.Project); I.Expect(actual).Not.ToBeNull(); I.Expect(actual.RunOnBuild).ToBeNullOrFalse(); I.Expect(actual.RunOnSave).ToBeNullOrFalse(); I.Expect(actual.CancelBuild).ToBeNullOrFalse(); I.Expect(actual.Options).ToBeNull(); } finally { testable.DeleteSettings(); } } }
public void Spec02() { using (var testable = new GetSettingsTestable()) { testable.WriteSettings(@"<NOT>JSON</NOT>"); try { var actual = testable.Instance.LoadSettings(testable.Project); I.Expect(actual).Not.ToBeNull(); I.Expect(actual.RunOnBuild).ToBeNullOrFalse(); I.Expect(actual.RunOnSave).ToBeNullOrFalse(); I.Expect(actual.CancelBuild).ToBeNullOrFalse(); I.Expect(actual.Options).ToBeNull(); } finally { testable.DeleteSettings(); } } }