public void ResolveTest(string revisionId, string expected) { var result = RevisionId.Parse(revisionId).Resolve( resolveBase: () => "base", resolveSelected: s => $"Selected {s.Revision}", resolveHash: h => $"Hash {h.CommitHash}" ); Assert.That(result, Is.EqualTo(expected)); }
public void ParseTest(string input, IResolveConstraint assert) { Assert.That(() => RevisionId.Parse(input), assert); }
public void InvalidInputParseTest(string s) { Assert.That(() => RevisionId.Parse(s), Throws.InstanceOf <ArgumentOutOfRangeException>()); Assert.That(RevisionId.TryParse(s, out _), Is.False); }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { return(RevisionId.Parse(reader.Value.ToString())); }