Пример #1
0
        public void ShouldCreateClassWithDependenciesAndSetup()
        {
            var magic = new MagicMoq.Moqer();
            var foo   = magic.Resolve <Foo>();

            magic.GetMock <IFooDependency>().Setup(a => a.DoSomethingDifferent()).Returns(2);

            foo.DoSomething().Should().Be(2);
        }
Пример #2
0
        public void ShouldCreateClassWithDependenciesAndVerify()
        {
            var magic = new MagicMoq.Moqer();
            var foo   = magic.Resolve <Foo>();

            foo.DoSomething();

            magic.GetMock <IFooDependency>().Verify(a => a.DoSomethingDifferent(), Times.Once());
        }
Пример #3
0
        public void ShouldCreateClassWithDependenciesAndVerify()
        {
            var magic = new MagicMoq.Moqer();
            var foo = magic.Resolve<Foo>();

            foo.DoSomething();

            magic.GetMock<IFooDependency>().Verify(a => a.DoSomethingDifferent(), Times.Once());
        }
Пример #4
0
        public void ShouldCreateClassWithDependenciesAndSetup()
        {
            var magic = new MagicMoq.Moqer();
            var foo = magic.Resolve<Foo>();

            magic.GetMock<IFooDependency>().Setup(a => a.DoSomethingDifferent()).Returns(2);

            foo.DoSomething().Should().Be(2);
        }