Ejemplo n.º 1
0
        public void Should_Throw_If_AttributeName_Is_Null()
        {
            // Given
            var context       = Substitute.For <ICakeContext>();
            var propertyName  = "proxyAddresses";
            var propertyValue = "*****@*****.**";
            var settings      = new UserSettings();

            // When
            var result = Record.Exception(() => ActiveDirectoryAliases.FindAttributeValueByProperty(
                                              context, propertyName, propertyValue, null, settings));

            // Then
            result.ShouldBeType <ArgumentNullException>().ParamName.ShouldEqual("attributeName");
        }
Ejemplo n.º 2
0
        public void Should_Throw_If_Context_Is_Null()
        {
            // Given
            var propertyName  = "proxyAddresses";
            var propertyValue = "*****@*****.**";
            var attributeName = "distinguishedName";
            var settings      = new UserSettings();

            // When
            var result = Record.Exception(() => ActiveDirectoryAliases.FindAttributeValueByProperty(
                                              null, propertyName, propertyValue, attributeName, settings));

            // Then
            result.ShouldBeType <ArgumentNullException>().ParamName.ShouldEqual("context");
        }