예제 #1
0
 public void BindToName_NullDefaults()
 {
     var b = new TrackAllBindToTypes();
     string assemblyName, typeName;
     b.BindToName(typeof(string), out assemblyName, out typeName);
     Assert.Null(assemblyName);
     Assert.Null(typeName);
 }
예제 #2
0
        public void BindToName_NullDefaults()
        {
            var    b = new TrackAllBindToTypes();
            string assemblyName, typeName;

            b.BindToName(typeof(string), out assemblyName, out typeName);
            Assert.Null(assemblyName);
            Assert.Null(typeName);
        }
예제 #3
0
        public void BindToType_AllValuesTracked()
        {
            var s = new MemoryStream();
            var f = new BinaryFormatter();

            f.Serialize(s, DayOfWeek.Monday);
            s.Position = 0;

            var t = new TrackAllBindToTypes();
            f.Binder = t;
            f.Deserialize(s);

            Assert.Contains(t.Binds, kvp => kvp.Value.Contains("System.DayOfWeek"));
        }
예제 #4
0
        public void BindToType_AllValuesTracked()
        {
            var s = new MemoryStream();
            var f = new BinaryFormatter();

            f.Serialize(s, DayOfWeek.Monday);
            s.Position = 0;

            var t = new TrackAllBindToTypes();

            f.Binder = t;
            f.Deserialize(s);

            Assert.Contains(t.Binds, kvp => kvp.Value.Contains("System.DayOfWeek"));
        }