public void SetupTest()
 {
     new FileSystemHelper(this).CreateAzureSdkDirectoryAndImportPublishSettings();
     client = new Mock<ServiceBusClientExtensions>();
     mockCommandRuntime = new MockCommandRuntime();
     cmdlet = new GetAzureSBNamespaceCommand()
     {
         CommandRuntime = mockCommandRuntime,
         Client = client.Object
     };
 }
Esempio n. 2
0
 public void SetupTest()
 {
     new FileSystemHelper(this).CreateAzureSdkDirectoryAndImportPublishSettings();
     client             = new Mock <ServiceBusClientExtensions>();
     mockCommandRuntime = new MockCommandRuntime();
     cmdlet             = new GetAzureSBNamespaceCommand()
     {
         CommandRuntime = mockCommandRuntime,
         Client         = client.Object
     };
 }
Esempio n. 3
0
 public void SetupTest()
 {
     CmdletSubscriptionExtensions.SessionManager = new InMemorySessionManager();
     new FileSystemHelper(this).CreateAzureSdkDirectoryAndImportPublishSettings();
     channel            = new SimpleServiceBusManagement();
     mockCommandRuntime = new MockCommandRuntime();
     cmdlet             = new GetAzureSBNamespaceCommand(channel)
     {
         CommandRuntime = mockCommandRuntime
     };
 }
Esempio n. 4
0
 public GetAzureSBNamespaceTests()
 {
     new FileSystemHelper(this).CreateAzureSdkDirectoryAndImportPublishSettings();
     client             = new Mock <ServiceBusClientExtensions>();
     mockCommandRuntime = new MockCommandRuntime();
     cmdlet             = new GetAzureSBNamespaceCommand()
     {
         CommandRuntime = mockCommandRuntime,
         Client         = client.Object
     };
     AzureSession.AuthenticationFactory = new MockAuthenticationFactory();
 }
        public void GetAzureSBNamespaceWithInvalidNamesFail()
        {
            // Setup
            string[] invalidNames = { "1test", "test#", "test invaid", "-test", "_test" };

            foreach (string invalidName in invalidNames)
            {
                MockCommandRuntime mockCommandRuntime = new MockCommandRuntime();
                GetAzureSBNamespaceCommand cmdlet = new GetAzureSBNamespaceCommand() { Name = invalidName, CommandRuntime = mockCommandRuntime };
                string expected = string.Format("{0}\r\nParameter name: Name", string.Format(Resources.InvalidNamespaceName, invalidName));

                Testing.AssertThrows<ArgumentException>(() => cmdlet.ExecuteCmdlet(), expected);
            }
        }
Esempio n. 6
0
        public void GetAzureSBNamespaceWithInvalidNamesFail()
        {
            // Setup
            string[] invalidNames = { "1test", "test#", "test invaid", "-test", "_test" };

            foreach (string invalidName in invalidNames)
            {
                MockCommandRuntime         mockCommandRuntime = new MockCommandRuntime();
                GetAzureSBNamespaceCommand cmdlet             = new GetAzureSBNamespaceCommand()
                {
                    Name = invalidName, CommandRuntime = mockCommandRuntime
                };
                string expected = string.Format("{0}\r\nParameter name: Name", string.Format(Resources.InvalidNamespaceName, invalidName));

                Testing.AssertThrows <ArgumentException>(() => cmdlet.ExecuteCmdlet(), expected);
            }
        }
Esempio n. 7
0
        public void GetAzureSBNamespaceWithInvalidNamesFail()
        {
            // Setup
            string[] invalidNames = { "1test", "test#", "test invaid", "-test", "_test" };
            Mock <ServiceBusClientExtensions> client = new Mock <ServiceBusClientExtensions>();

            foreach (string invalidName in invalidNames)
            {
                MockCommandRuntime         mockCommandRuntime = new MockCommandRuntime();
                GetAzureSBNamespaceCommand cmdlet             = new GetAzureSBNamespaceCommand()
                {
                    Name           = invalidName,
                    CommandRuntime = mockCommandRuntime,
                    Client         = client.Object
                };
                string expected = string.Format("{0}\r\nParameter name: Name", string.Format(Resources.InvalidNamespaceName, invalidName));
                client.Setup(f => f.GetNamespace(invalidName)).Throws(new InvalidOperationException(expected));

                Testing.AssertThrows <InvalidOperationException>(() => cmdlet.ExecuteCmdlet(), expected);
            }
        }
 public void SetupTest()
 {
     CmdletSubscriptionExtensions.SessionManager = new InMemorySessionManager();
     new FileSystemHelper(this).CreateAzureSdkDirectoryAndImportPublishSettings();
     channel = new SimpleServiceBusManagement();
     mockCommandRuntime = new MockCommandRuntime();
     cmdlet = new GetAzureSBNamespaceCommand(channel) { CommandRuntime = mockCommandRuntime };
 }
 public void SetupTest()
 {
     Management.Extensions.CmdletSubscriptionExtensions.SessionManager = new InMemorySessionManager();
     channel = new SimpleServiceManagement();
     mockCommandRuntime = new MockCommandRuntime();
     cmdlet = new GetAzureSBNamespaceCommand(channel) { CommandRuntime = mockCommandRuntime };
 }
 public void SetupTest()
 {
     Management.Extensions.CmdletSubscriptionExtensions.SessionManager = new InMemorySessionManager();
     channel = new SimpleServiceManagement();
     writer = new FakeWriter();
     cmdlet = new GetAzureSBNamespaceCommand(channel) { Writer = writer };
 }