public void Test_CreateIdentity_WithEdgelet_SetAuthScheme_ShouldCreateIdentity(
            string iotHubHostName,
            string deviceId,
            string moduleId,
            string generationId,
            string edgeletUri,
            string authScheme = "sasToken")
        {
            // Arrange
            var builder = new ModuleIdentityProviderServiceBuilder(iotHubHostName, deviceId);

            // Act
            IModuleIdentity identity = builder.Create(moduleId, generationId, edgeletUri, authScheme);

            // Assert
            Assert.Equal(iotHubHostName, identity.IotHubHostname);
            Assert.Equal(deviceId, identity.DeviceId);
            Assert.Equal(moduleId, identity.ModuleId);
            var creds = identity.Credentials as IdentityProviderServiceCredentials;

            Assert.NotNull(creds);
            Assert.Equal(edgeletUri, creds.ProviderUri);
            Assert.Equal(authScheme, creds.AuthScheme);
            Assert.Equal(generationId, creds.ModuleGenerationId);
            Assert.Equal(Option.None <string>(), creds.Version);
        }
        public void InvalidInputsTest()
        {
            Assert.Throws <ArgumentException>(() => new ModuleIdentityProviderServiceBuilder(null, "1", "gateway"));
            Assert.Throws <ArgumentException>(() => new ModuleIdentityProviderServiceBuilder("", "1", "gateway"));
            Assert.Throws <ArgumentException>(() => new ModuleIdentityProviderServiceBuilder("iothub", null, "gateway"));
            Assert.Throws <ArgumentException>(() => new ModuleIdentityProviderServiceBuilder("iothub", "", "gateway"));

            var builder = new ModuleIdentityProviderServiceBuilder("foo.azure.com", "device1", "gateway");

            Assert.Throws <ArgumentException>(() => builder.Create(null, "1", "xyz"));
            Assert.Throws <ArgumentException>(() => builder.Create("localhost", null, "xyz"));
            Assert.Throws <ArgumentException>(() => builder.Create("localhost", "1", null));
            Assert.Throws <ArgumentException>(() => builder.Create(null, "localhost", "1", "sasToken"));
            Assert.Throws <ArgumentException>(() => builder.Create("module1", null, "1", "sasToken"));
            Assert.Throws <ArgumentException>(() => builder.Create("module1", "localhost", null, "sasToken"));
            Assert.Throws <ArgumentException>(() => builder.Create("module1", "localhost", "1", null));
        }