コード例 #1
0
        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));
        }
コード例 #2
0
 public void ParseTest(string input, IResolveConstraint assert)
 {
     Assert.That(() => RevisionId.Parse(input), assert);
 }
コード例 #3
0
 public void InvalidInputParseTest(string s)
 {
     Assert.That(() => RevisionId.Parse(s), Throws.InstanceOf <ArgumentOutOfRangeException>());
     Assert.That(RevisionId.TryParse(s, out _), Is.False);
 }
コード例 #4
0
 public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
 {
     return(RevisionId.Parse(reader.Value.ToString()));
 }