public void ConstructorTest() { AzureDeviceParameters instaneToTest = AzureDeviceParameters.ParseRepositoryGroup(String.Empty); Assert.IsNotNull(instaneToTest); Assert.IsTrue(String.IsNullOrEmpty(instaneToTest.AzureDeviceId)); Assert.IsTrue(String.IsNullOrEmpty(instaneToTest.AzurePrimaryKey)); Assert.IsTrue(String.IsNullOrEmpty(instaneToTest.AzureScopeId)); Assert.IsTrue(String.IsNullOrEmpty(instaneToTest.AzureSecondaryKey)); Assert.AreEqual <TimeSpan>(TimeSpan.FromSeconds(1.0), instaneToTest.PublishingInterval()); Assert.AreEqual <TransportType>(default(TransportType), instaneToTest.TransportType); Assert.IsTrue(String.IsNullOrEmpty(instaneToTest.ResourceGroupName)); }
public void ParseMissingRepositoryGroupTestMethod() { AzureDeviceParameters instaneToTest = AzureDeviceParameters.ParseRepositoryGroup("-dAzureDeviceId -sAzureScopeId -pAzurePrimaryKey -kAzureSecondaryKey "); Assert.IsNotNull(instaneToTest); Assert.AreEqual <string>("AzureDeviceId", instaneToTest.AzureDeviceId); Assert.AreEqual <string>("AzurePrimaryKey", instaneToTest.AzurePrimaryKey); Assert.AreEqual <string>("AzureScopeId", instaneToTest.AzureScopeId); Assert.AreEqual <string>("AzureSecondaryKey", instaneToTest.AzureSecondaryKey); Assert.AreEqual <TimeSpan>(TimeSpan.FromSeconds(1.0), instaneToTest.PublishingInterval()); Assert.AreEqual <TransportType>(TransportType.Amqp, instaneToTest.TransportType); Assert.AreEqual <string>("", instaneToTest.ResourceGroupName); }
public void RepositoryGroupTest() { PartConfigurationFactory configurationFactory = new PartConfigurationFactory(_ConfigurationFilePath); ConfigurationData configuartion = configurationFactory.GetConfiguration(); Assert.AreEqual <string>("BoilersArea_Boiler_#1 -tHttp1 -dAzureDeviceId -sAzureScopeId -pAzurePrimaryKey -kAzureSecondaryKey -i2000", configuartion.DataSets[0].RepositoryGroup); AzureDeviceParameters instaneToTest = AzureDeviceParameters.ParseRepositoryGroup(configuartion.DataSets[0].RepositoryGroup); Assert.IsNotNull(instaneToTest); Assert.AreEqual <string>("AzureDeviceId", instaneToTest.AzureDeviceId); Assert.AreEqual <string>("AzurePrimaryKey", instaneToTest.AzurePrimaryKey); Assert.AreEqual <string>("AzureScopeId", instaneToTest.AzureScopeId); Assert.AreEqual <string>("AzureSecondaryKey", instaneToTest.AzureSecondaryKey); Assert.AreEqual <TimeSpan>(TimeSpan.FromSeconds(2.0), instaneToTest.PublishingInterval()); Assert.AreEqual <TransportType>(TransportType.Http1, instaneToTest.TransportType); Assert.AreEqual <string>("BoilersArea_Boiler_#1", instaneToTest.ResourceGroupName); }