public void Throw_If_Given_Bad_Args() { var method = new TagMethod(); Action a = () => method.ExtractAddOptions(new[] { "-t", "title", "-b" }); Action a2 = () => method.ExtractAddOptions(new[] { "-t" }); a.Should().Throw <ArgumentException>(); a2.Should().Throw <ArgumentException>(); }
public void Parse_Add_Options() { var tagMethod = new TagMethod(); var a = tagMethod.ExtractAddOptions(new[] { "note1", "-a" }); var a2 = tagMethod.ExtractAddOptions(new[] { "-a", "note1" }); var n = tagMethod.ExtractAddOptions(new[] { "this is content" }); a.IsAllThreadsAtPosition.Should().BeTrue(); a.Text.Should().Be("note1"); a2.IsAllThreadsAtPosition.Should().BeTrue(); a2.Text.Should().Be("note1"); n.IsAllThreadsAtPosition.Should().BeFalse(); n.Text.Should().Be("this is content"); }