Beispiel #1
0
        public void ConstructorTest3()
        {
            IElementLocation location = ElementLocation.Create("file", 65536, 65537);

            Assert.AreEqual("file", location.File);
            Assert.AreEqual(65536, location.Line);
            Assert.AreEqual(65537, location.Column);
            Assert.IsTrue(location.GetType().FullName.Contains("RegularElementLocation"));
        }
Beispiel #2
0
        public void ConstructorTest3_SmallElementLocation()
        {
            IElementLocation location = ElementLocation.Create("file", 65535, 65534);

            Assert.AreEqual("file", location.File);
            Assert.AreEqual(65535, location.Line);
            Assert.AreEqual(65534, location.Column);
            Assert.IsTrue(location.GetType().FullName.Contains("SmallElementLocation"));
        }
Beispiel #3
0
        public void SerializationTest_SmallElementLocation()
        {
            IElementLocation location = ElementLocation.Create("file", 65535, 2);

            TranslationHelpers.GetWriteTranslator().Translate(ref location, ElementLocation.FactoryForDeserialization);
            IElementLocation deserializedLocation = null;

            TranslationHelpers.GetReadTranslator().Translate(ref deserializedLocation, ElementLocation.FactoryForDeserialization);

            Assert.AreEqual(location.File, deserializedLocation.File);
            Assert.AreEqual(location.Line, deserializedLocation.Line);
            Assert.AreEqual(location.Column, deserializedLocation.Column);
            Assert.IsTrue(location.GetType().FullName.Contains("SmallElementLocation"));
        }