示例#1
0
        public async Task CreateShouldThrowExceptionIfSubscriptionIsInAnotherAccount()
        {
            ServiceTestContext testContext = new ServiceTestContext();

            testContext.Subscriptions = new List <IAzureUserAccountSubscriptionContext>
            {
                ServiceTestContext.CreateSubscriptionContext(),
                    ServiceTestContext.CreateSubscriptionContext(),
            };

            testContext = CreateMocks(testContext);
            await Assert.ThrowsAsync <FirewallRuleException>(() => VerifyCreateAsync(testContext, testContext.ServerName, false));
        }
示例#2
0
        public async Task CreateShouldFindTheRightSubscriptionGivenValidSubscriptionInSecondPlace()
        {
            ServiceTestContext testContext = new ServiceTestContext();

            testContext.Subscriptions = new List <IAzureUserAccountSubscriptionContext>
            {
                ServiceTestContext.CreateSubscriptionContext(),
                    testContext.ValidSubscription,
                    ServiceTestContext.CreateSubscriptionContext(),
            };
            testContext.Initialize();
            testContext = CreateMocks(testContext);
            await VerifyCreateAsync(testContext, testContext.ServerName);
        }