Esempio n. 1
0
        public void CreateProxy_CallAddMethod_AddsTwoIntegers()
        {
            var proxy     = new MyProxy();
            var realProxy = proxy.GetProxyObject();

            Assert.IsNotNull(realProxy);
            Assert.AreEqual(100, realProxy.Add(40, 60));
        }
Esempio n. 2
0
        public void CreateProxy_WithProperty_GetsAndSetsProperty()
        {
            var proxy     = new MyProxy();
            var realProxy = proxy.GetProxyObject();

            Assert.IsNotNull(realProxy);

            realProxy.StringProperty = "Test";
            Assert.AreEqual("Test", realProxy.StringProperty);
        }
Esempio n. 3
0
        public void CreateProxy_WithMethodContainingAValueOutParameter_ReturnsOutParameter()
        {
            var proxy     = new MyProxy();
            var realProxy = proxy.GetProxyObject();

            Assert.IsNotNull(realProxy);

            realProxy.BooleanProperty = true;
            var result = realProxy.TryGetBooleanProperty(out bool value);

            Assert.IsTrue(result);
            Assert.IsTrue(value);
        }
Esempio n. 4
0
        public void CreateProxy_WithMethodContainingAReferenceOutParameter_ReturnsOutParameter()
        {
            var proxy     = new MyProxy();
            var realProxy = proxy.GetProxyObject();

            Assert.IsNotNull(realProxy);

            realProxy.StringProperty = "Test";
            var result = realProxy.TryGetStringProperty(out string value);

            Assert.IsTrue(result);
            Assert.AreEqual("Test", value);
        }
Esempio n. 5
0
 public void CreateProxy()
 {
     var proxy     = new MyProxy();
     var realProxy = proxy.GetProxyObject();
 }
Esempio n. 6
0
        public void GlobalSetupSimple()
        {
            var proxy = new MyProxy();

            this.realProxy = proxy.GetProxyObject();
        }