Exemple #1
0
 public void When_ThereAreMoreParts_ShouldThrowAnException()
 {
     Should.Throw <FormatException>(() =>
     {
         var _ = ScramAttribute.Parse("value");
     });
 }
Exemple #2
0
 public void When_NameIsTwoCharacters_ShouldThrowAnException()
 {
     Should.Throw <FormatException>(() =>
     {
         var _ = ScramAttribute.Parse("bh=name");
     });
 }
        public void When_CreatingTwoAttributes_TheHashCodesShouldBeEqual()
        {
            var first  = ScramAttribute.Parse("v=rmF9pqV8S7suAoZWja4dJRkFsKQ=");
            var second = new ServerSignatureAttribute("rmF9pqV8S7suAoZWja4dJRkFsKQ=");

            first.GetHashCode().ShouldBe(second.GetHashCode());
        }
        public void When_CreatedByParsing_ValueShouldBeValid()
        {
            var attribute = ScramAttribute.Parse("v=rmF9pqV8S7suAoZWja4dJRkFsKQ=");
            var result    = new ServerSignatureAttribute("rmF9pqV8S7suAoZWja4dJRkFsKQ=");

            attribute.ShouldBe(result);
        }
Exemple #5
0
        public void When_ParsingAnUnknownAttribute_ShouldBeValid()
        {
            var attribute = ScramAttribute.Parse("h=name");

            attribute.ShouldBeOfType <UnknownAttribute>();
        }
Exemple #6
0
        public void When_ParsingAClientProofAttribute_ShouldBeValid()
        {
            var attribute = ScramAttribute.Parse("p=v0X8v3Bz2T0CJGbJQyF0X+HI4Ts=");

            attribute.ShouldBeOfType <ClientProofAttribute>();
        }
Exemple #7
0
        public void When_ParsingAChannelAttribute_ShouldBeValid()
        {
            var attribute = ScramAttribute.Parse("c=biws");

            attribute.ShouldBeOfType <ChannelAttribute>();
        }
Exemple #8
0
        public void When_ParsingAUserAttribute_ShouldBeValid()
        {
            var attribute = ScramAttribute.Parse("n=name");

            attribute.ShouldBeOfType <UserAttribute>();
        }
Exemple #9
0
        public void When_ParsingAnAuthorizationAttribute_ShouldBeValid()
        {
            var attribute = ScramAttribute.Parse("a=name");

            attribute.ShouldBeOfType <AuthorizationIdentityAttribute>();
        }
        public void When_AttributeIsComparedToItself_ShouldBeEqual()
        {
            var attribute = ScramAttribute.Parse("v=rmF9pqV8S7suAoZWja4dJRkFsKQ=");

            Assert.True(attribute.Equals(attribute));
        }
        public void When_AttributeIsNotNull_ShouldBeEqual()
        {
            var attribute = ScramAttribute.Parse("v=rmF9pqV8S7suAoZWja4dJRkFsKQ=");

            Assert.False(attribute.Equals(null));
        }