Esempio n. 1
0
        public void When_SetterForParameterProperty_Expect_DirectAccess()
        {
            var p      = new ParameterExample();
            var setter = p.GetSetter("parameter1");

            Assert.AreEqual(false, p.Parameter1.Given);
            setter(1.0);
            Assert.AreEqual(1.0, p.Parameter1.Value, 1e-12);
            Assert.AreEqual(true, p.Parameter1.Given);
        }
Esempio n. 2
0
        public void When_SetterForMethod_Expect_DirectAccess()
        {
            var p      = new ParameterExample();
            var setter = p.GetSetter("method1");

            setter(1.0);
            Assert.AreEqual(1.0, p.Property1, 1e-12);
            setter(10.0);
            Assert.AreEqual(10.0, p.Property1, 1e-12);
        }
Esempio n. 3
0
        public void When_SetterForField_Expect_DirectAccess()
        {
            var p      = new ParameterExample();
            var setter = p.GetSetter("field1");

            setter(1.0);
            Assert.AreEqual(1.0, p.Field1, 1e-12);
            setter(10.0);
            Assert.AreEqual(10.0, p.Field1, 1e-12);
        }
Esempio n. 4
0
        public void When_PrincipalSetter_Expect_DirectAccess()
        {
            var p      = new ParameterExample();
            var setter = p.GetSetter();

            setter(1.0);
            Assert.AreEqual(1.0, p.Principal.Value, 1e-12);
            setter(10.0);
            Assert.AreEqual(10.0, p.Principal.Value, 1e-12);
        }
Esempio n. 5
0
        public void When_SetterForGetOnlyProperty_Expect_Null()
        {
            var p = new ParameterExample();

            Assert.AreEqual(null, p.GetSetter("property1"));
        }