Esempio n. 1
0
        public void When_SetterForParameterProperty_Expect_DirectAccess()
        {
            var p      = new ParameterExample();
            var setter = p.CreateParameterSetter <double>("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_SetterForProperty_Expect_DirectAccess()
        {
            var p      = new ParameterExample();
            var setter = p.CreateParameterSetter <int>("property2");

            setter(1);
            Assert.AreEqual(1, p.Property2);
            setter(10);
            Assert.AreEqual(10, p.Property2);
        }
Esempio n. 3
0
        public void When_SetterForMethod_Expect_DirectAccess()
        {
            var p      = new ParameterExample();
            var setter = p.CreateParameterSetter <double>("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. 4
0
        public void When_SetterForGetOnlyProperty_Expect_Null()
        {
            var p = new ParameterExample();

            Assert.AreEqual(null, p.CreateParameterSetter <double>("property1"));
        }