Exemplo n.º 1
0
 protected bool Equals(DefinedByFile other)
 {
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(string.Equals(MyString, other.MyString) && MyInt == other.MyInt);
 }
Exemplo n.º 2
0
        public void SchemaInFilePasses()
        {
            var json = new JsonObject
            {
                ["MyString"] = "some string",
                ["MyInt"]    = 15
            };
            var expected = new DefinedByFile
            {
                MyString = "some string",
                MyInt    = 15
            };

            Directory.SetCurrentDirectory(System.IO.Path.Combine(TestContext.CurrentContext.TestDirectory, "Files"));
            var actual = new JsonSerializer().Deserialize <DefinedByFile>(json);

            Assert.AreEqual(expected, actual);
        }