public async Task Text_with_Alpha_originator()
        {
            // ARRANGE
            Originator originator = Originator.AsAlpha("ABC");
            var        message    = new TextSmsMessage("Hello, World!", "0012345")
            {
                MaxMessageCount = 1,
                EncodingType    = TextEncodingType.Gsm0338
            };

            // ACT
            await _gateway.Send(originator, message);

            // ASSERT
            AssertBody(new Dictionary <string, string>
            {
                { "username", "MyName" },
                { "password", "MyPassword" },
                { "originatortype", "alpha" },
                { "originator", "ABC" },
                { "destination", "0012345" },
                { "type", "text" },
                { "charset", "UTF-8" },
                { "text", "Hello, World!" }
            });
        }
Beispiel #2
0
            public void Non_Supported_chars_when_not_strict_is_valid()
            {
                Originator originator = Originator.AsAlpha("Café", false);

                originator.ShouldNotBeNull();
                originator.Type.ShouldBe(OriginatorType.Alpha);
                originator.Value.ShouldBe("Café");
            }
Beispiel #3
0
            public void Eleven_chars_is_valid()
            {
                Originator originator = Originator.AsAlpha("AbCZz12h39Q");

                originator.ShouldNotBeNull();
                originator.Type.ShouldBe(OriginatorType.Alpha);
                originator.Value.ShouldBe("AbCZz12h39Q");
            }
Beispiel #4
0
            public void Five_chars_is_valid()
            {
                Originator originator = Originator.AsAlpha("Abc42");

                originator.ShouldNotBeNull();
                originator.Type.ShouldBe(OriginatorType.Alpha);
                originator.Value.ShouldBe("Abc42");
            }
Beispiel #5
0
 public void Non_Supported_chars_when_strict_is_invalid()
 {
     Should.Throw <OriginatorException>(() => Originator.AsAlpha("Café", true))
     .ErrorCode.ShouldBe(OriginatorErrorCode.UnsupportedChars);
 }
Beispiel #6
0
 public void Twelve_digits_is_invalid()
 {
     Should.Throw <OriginatorException>(() => Originator.AsAlpha("AbCZz12h39QX"))
     .ErrorCode.ShouldBe(OriginatorErrorCode.TooLong);
 }
Beispiel #7
0
 public void Empty_is_invalid()
 {
     Should.Throw <OriginatorException>(() => Originator.AsAlpha(string.Empty))
     .ErrorCode.ShouldBe(OriginatorErrorCode.Empty);
 }
Beispiel #8
0
 public void Null_is_invalid()
 {
     Should.Throw <ArgumentNullException>(() => Originator.AsAlpha(null));
 }