示例#1
0
        public virtual async Task SimpleArrayValuesTest()
        {
            using (BitOwinTestEnvironment testEnvironment = new BitOwinTestEnvironment(new TestEnvironmentArgs {
                UseRealServer = true
            }))
            {
                Token token = await testEnvironment.Server.LoginWithCredentials("ValidUserName", "ValidPassword", clientId : "TestResOwner");

                using (RemoteWebDriver driver = testEnvironment.Server.BuildWebDriver(new RemoteWebDriverOptions {
                    Token = token
                }))
                {
                    await driver.ExecuteTest("simpleArrayValuesTest");
                }

                TestComplexController controllerForSimpleValuesArray = testEnvironment.GetObjects <TestComplexController>()
                                                                       .Single();

                A.CallTo(() => controllerForSimpleValuesArray.GetValues(A <IEnumerable <int> > .That.Matches(values => values != null), A <CancellationToken> .Ignored))
                .MustHaveHappenedOnceExactly();
            }
        }
示例#2
0
        public virtual async Task SimpleArrayValuesTest()
        {
            using (BitOwinTestEnvironment testEnvironment = new BitOwinTestEnvironment(new TestEnvironmentArgs {
                UseRealServer = true
            }))
            {
                TokenResponse token = await testEnvironment.Server.Login("ValidUserName", "ValidPassword", clientId : "TestResOwner");

                using (RemoteWebDriver driver = testEnvironment.Server.BuildWebDriver(new RemoteWebDriverOptions {
                    Token = token
                }))
                {
                    await driver.ExecuteTest("simpleArrayValuesTest");
                }

                TestComplexController controllerForSimpleValuesArray = TestDependencyManager.CurrentTestDependencyManager.Objects
                                                                       .OfType <TestComplexController>()
                                                                       .Single();

                A.CallTo(() => controllerForSimpleValuesArray.GetValues(A <TestComplexController.GetValuesParameters> .That.Matches(parameters => parameters.values != null), A <CancellationToken> .Ignored))
                .MustHaveHappenedOnceExactly();
            }
        }
示例#3
0
        public virtual void SimpleArrayValuesTest()
        {
            using (TestEnvironment testEnvironment = new TestEnvironment(new TestEnvironmentArgs {
                UseRealServer = true
            }))
            {
                OAuthToken token = testEnvironment.Server.Login("ValidUserName", "ValidPassword");

                using (RemoteWebDriver driver = testEnvironment.Server.GetWebDriver(new RemoteWebDriverOptions {
                    Token = token
                }))
                {
                    driver.ExecuteTest("simpleArrayValuesTest");
                }

                TestComplexController controllerForSimpleValuesArray = TestDependencyManager.CurrentTestDependencyManager.Objects
                                                                       .OfType <TestComplexController>()
                                                                       .Single();

                A.CallTo(() => controllerForSimpleValuesArray.GetValues(A <ODataActionParameters> .That.Matches(parameters => parameters.ContainsKey("values")), A <CancellationToken> .Ignored))
                .MustHaveHappened(Repeated.Exactly.Once);
            }
        }