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!" } }); }
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é"); }
public void Eleven_chars_is_valid() { Originator originator = Originator.AsAlpha("AbCZz12h39Q"); originator.ShouldNotBeNull(); originator.Type.ShouldBe(OriginatorType.Alpha); originator.Value.ShouldBe("AbCZz12h39Q"); }
public void Five_chars_is_valid() { Originator originator = Originator.AsAlpha("Abc42"); originator.ShouldNotBeNull(); originator.Type.ShouldBe(OriginatorType.Alpha); originator.Value.ShouldBe("Abc42"); }
public void Non_Supported_chars_when_strict_is_invalid() { Should.Throw <OriginatorException>(() => Originator.AsAlpha("Café", true)) .ErrorCode.ShouldBe(OriginatorErrorCode.UnsupportedChars); }
public void Twelve_digits_is_invalid() { Should.Throw <OriginatorException>(() => Originator.AsAlpha("AbCZz12h39QX")) .ErrorCode.ShouldBe(OriginatorErrorCode.TooLong); }
public void Empty_is_invalid() { Should.Throw <OriginatorException>(() => Originator.AsAlpha(string.Empty)) .ErrorCode.ShouldBe(OriginatorErrorCode.Empty); }
public void Null_is_invalid() { Should.Throw <ArgumentNullException>(() => Originator.AsAlpha(null)); }