Skip to content

Commit

Permalink
Added new field
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanbulfinMS committed Feb 1, 2022
1 parent 00ab690 commit 60a3475
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions provisioning/service/src/Config/IndividualEnrollment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ public override string ToString()
[JsonProperty(PropertyName = "registrationState", DefaultValueHandling = DefaultValueHandling.Ignore)]
public DeviceRegistrationState RegistrationState { get; private set; }

/// <summary>
/// Optional Device Information.
/// </summary>
[JsonProperty(PropertyName = "optionalDeviceInformation")]
public TwinCollection OptionalDeviceInformation { get; set; }

/// <summary>
/// Attestation Mechanism
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public class IndividualEnrollmentTests
" }\n" +
" }\n" +
" },\n" +
" \"optionalDeviceInformation\":{\n" +
" \"tag1\":\"val1\",\n" +
" \"tag2\":\"val2\"\n" +
" },\n" +
" \"iotHubHostName\":\"" + SampleIotHubHostName + "\",\n" +
" \"deviceId\":\"" + SampleDeviceId + "\",\n" +
" \"initialTwin\":{\n" +
Expand Down Expand Up @@ -266,6 +270,7 @@ public void IndividualEnrollmentConstructorWithoutCapabilitiesJSONSucceed()
Assert.IsTrue(individualEnrollment.Attestation is X509Attestation);
Assert.AreEqual(SampleDeviceId, individualEnrollment.DeviceId);
Assert.AreEqual(SampleIotHubHostName, individualEnrollment.IotHubHostName);
Assert.IsNotNull(individualEnrollment.OptionalDeviceInformation);
Assert.IsNotNull(individualEnrollment.InitialTwinState);
Assert.AreEqual(SampleProvisioningStatus, individualEnrollment.ProvisioningStatus);
Assert.AreEqual(SampleCreateDateTimeUTC, individualEnrollment.CreatedDateTimeUtc);
Expand All @@ -286,6 +291,7 @@ public void IndividualEnrollmentConstructorWithCapabilitiesTrueJSONSucceed()
Assert.IsTrue(individualEnrollment.Attestation is X509Attestation);
Assert.AreEqual(SampleDeviceId, individualEnrollment.DeviceId);
Assert.AreEqual(SampleIotHubHostName, individualEnrollment.IotHubHostName);
Assert.IsNotNull(individualEnrollment.OptionalDeviceInformation);
Assert.IsNotNull(individualEnrollment.InitialTwinState);
Assert.AreEqual(SampleProvisioningStatus, individualEnrollment.ProvisioningStatus);
Assert.AreEqual(SampleCreateDateTimeUTC, individualEnrollment.CreatedDateTimeUtc);
Expand All @@ -306,6 +312,7 @@ public void IndividualEnrollmentConstructorWithCapabilitiesFalseJSONSucceed()
Assert.IsTrue(individualEnrollment.Attestation is X509Attestation);
Assert.AreEqual(SampleDeviceId, individualEnrollment.DeviceId);
Assert.AreEqual(SampleIotHubHostName, individualEnrollment.IotHubHostName);
Assert.IsNotNull(individualEnrollment.OptionalDeviceInformation);
Assert.IsNotNull(individualEnrollment.InitialTwinState);
Assert.AreEqual(SampleProvisioningStatus, individualEnrollment.ProvisioningStatus);
Assert.AreEqual(SampleCreateDateTimeUTC, individualEnrollment.CreatedDateTimeUtc);
Expand Down

0 comments on commit 60a3475

Please sign in to comment.