Exemple #1
0
        public void InterfaceExample_MethodA()
        {
            //Arrange
            var interfaceExample = new InterfaceExample();

            //Act
            Execute(interfaceExample);
        }
Exemple #2
0
        public void InterfaceTestMethod()
        {
            InterfaceExample _ie  = new InterfaceExample();
            double           _val = _ie[c_OkIndex];

            _ie[1] = new Random().NextDouble();
            Assert.AreNotEqual(_val, _ie[c_OkIndex]);
        }
Exemple #3
0
        public void InteraceCountTestMethod()
        {
            InterfaceExample _ie = new InterfaceExample();
            int _length          = 0;

            foreach (double _item in _ie)
            {
                _length++;
            }
            Assert.AreEqual(_length, _ie.Count);
        }
Exemple #4
0
        public void RoundtripInterfaceProperties()
        {
            AssumingDeserializerWith(new LambdaObjectFactory(t =>
            {
                if (t == typeof(InterfaceExample)) { return new InterfaceExample(); }
                else if (t == typeof(IDerived)) { return new Derived(); }
                return null;
            }));

            var obj = new InterfaceExample
            {
                Derived = new Derived { BaseProperty = "foo", DerivedProperty = "bar" }
            };

            var result = DoRoundtripFromObjectTo<InterfaceExample>(obj);

            result.Derived.Should().BeOfType<Derived>().And
                .Subject.As<IDerived>().ShouldBeEquivalentTo(new { BaseProperty = "foo", DerivedProperty = "bar" }, o => o.ExcludingMissingMembers());
        }
Exemple #5
0
 public void InterfaceExceptionTestMethod()
 {
     InterfaceExample _ie  = new InterfaceExample();
     double           _val = _ie[c_WrongIndex];
 }