public void HappyPathTokenizedReturnsValue() { // arrange ClientTokenString cts = "[T__ABC1234__T][M__****lo__M]"; Assert.AreEqual("[T__ABC1234__T][M__****lo__M]", cts.OriginalValue); Assert.AreEqual("[T__ABC1234__T][M__****lo__M]", cts.ToString()); Assert.AreEqual("****lo", cts.MaskedValue); Assert.AreEqual(true, cts.IsTokenized()); }
public void HappyPathValueReturnsValue() { // arrange ClientTokenString cts = "Hello"; Assert.AreEqual("Hello", cts.OriginalValue); Assert.AreEqual("Hello", cts.ToString()); Assert.AreEqual("", cts.MaskedValue); Assert.AreEqual(false, cts.IsTokenized()); }
public override TokenBase Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { string val = reader.GetString(); if (typeToConvert == typeof(ClientTokenString)) { ClientTokenString cts = val; return(cts); } if (typeToConvert == typeof(ClientTokenDate)) { ClientTokenDate ctd = val; return(ctd); } throw new NotImplementedException($"No converter exists for {typeToConvert.FullName}"); }