Exemplo n.º 1
0
        public void StashItEasyTests_Mock_WithArg()
        {
            using (var mock = StashItEasy.Create())
            {
                var arg = new DepArg();
                var m   = mock.Fake <DepWithArg>(x => x.WithArgumentsForConstructor(new[] { arg }));

                Assert.Same(arg, m.Dep);
            }
        }
Exemplo n.º 2
0
        public void StashRhinoTest_Mock_WithArg()
        {
            using (var mock = StashRhino.Create())
            {
                var arg = new DepArg();
                var m   = mock.Mock <DepWithArg>(arg);

                Assert.Same(arg, m.Dep);
            }
        }
        public void StashSubstituteTests_Mock_WithArg_NonGeneric()
        {
            using (var mock = StashSubstitute.Create())
            {
                var arg = new DepArg();
                var m   = mock.Sub(new[] { typeof(DepWithArg) }, arg);

                Assert.Same(arg, ((DepWithArg)m).Dep);
            }
        }
        public void StashSubstituteTests_Mock_WithArg()
        {
            using (var mock = StashSubstitute.Create())
            {
                var arg = new DepArg();
                var m   = mock.Sub <DepWithArg>(arg);

                Assert.Same(arg, m.Dep);
            }
        }
        public void StashMoqTests_Mock_WithArg()
        {
            using (var mock = StashMoq.Create())
            {
                var arg = new DepArg();
                var m   = mock.Mock <DepWithArg>(args: arg);

                Assert.Same(arg, m.Object.Dep);
            }
        }
Exemplo n.º 6
0
        public void StashRocksTests_Mock_WithArg()
        {
            using (var mock = StashRocks.Create())
            {
                var arg = new DepArg();
                var m   = mock.Mock <DepWithArg>();
                var m1  = m.Make(new object[] { arg });

                Assert.Same(arg, m1.Dep);
            }
        }