public void PropertyValuesIsValid() { // Arrange. const string attributeTypeDescription = "description"; object[] attributeValuesDescription = { "Contractor" }; ModSpec modSpecDescription = new ModSpec(ModSpecType.Add, attributeTypeDescription, attributeValuesDescription); const string attributeTypeTelephoneNumber = "telephonenumber"; object[] attributeValuesTelephoneNumber = { "+1 (415) 555 1234" }; ModSpec modSpecTelephoneNumber = new ModSpec(ModSpecType.Replace, attributeTypeTelephoneNumber, attributeValuesTelephoneNumber); // Act. ChangeModify sut = new ChangeModify(DistinguishedName, new[] { modSpecDescription, modSpecTelephoneNumber }); ModSpec sutModSpecDescription = sut.ModSpecs.First(x => x.AttributeType.Equals(attributeTypeDescription)); ModSpec sutModSpecTelephoneNumber = sut.ModSpecs.First(x => x.AttributeType.Equals(attributeTypeTelephoneNumber)); // Assert. Assert.Equal(2, sut.ModSpecs.ToArray().Length); Assert.Equal(attributeTypeDescription, sutModSpecDescription.AttributeType); Assert.Equal(attributeValuesDescription, sutModSpecDescription.AttributeValues); Assert.Equal(attributeTypeTelephoneNumber, sutModSpecTelephoneNumber.AttributeType); Assert.Equal(attributeValuesTelephoneNumber, sutModSpecTelephoneNumber.AttributeValues); }
public void PropertyModSpecIsValid() { // Arrange. const string attributeType = "description"; const string attributeValue = "Contractor"; object[] values = { attributeValue }; // Act. ModSpec sut = new ModSpec(ModSpecType.Add, attributeType, values); // Assert. Assert.Equal(ModSpecType.Add, sut.ModSpecType); }
public void PropertyCountIsValid() { // Arrange. const string attributeType = "description"; const string attributeValueA = "Contractor"; const string attributeValueB = "Remote"; object[] values = { attributeValueA, attributeValueB }; // Act. ModSpec sut = new ModSpec(ModSpecType.Add, attributeType, values); // Assert. Assert.Equal(2, sut.Count); }
public void ShouldBeEnumerable() { // Arrange. const string attributeType = "description"; const string attributeValueA = "Contractor"; const string attributeValueB = "Remote"; string[] values = { attributeValueA, attributeValueB }; // Act. ModSpec modSpec = new ModSpec(ModSpecType.Add, attributeType, values); string[] sut = modSpec.AttributeValues.Select(x => (string)x).ToArray(); // Arrange. Assert.Equal(values, sut); }