Added basic WhatsApp implementation
All checks were successful
Branch Build / build-test-deploy (push) Successful in 1m23s
All checks were successful
Branch Build / build-test-deploy (push) Successful in 1m23s
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using AMWD.Net.Api.LinkMobility.WhatsApp;
|
||||
|
||||
namespace LinkMobility.Tests.WhatsApp.Contents
|
||||
{
|
||||
[TestClass]
|
||||
public class TextMessageContentTest
|
||||
{
|
||||
[TestMethod]
|
||||
[DataRow(true)]
|
||||
[DataRow(false)]
|
||||
public void ShouldValidateSuccessful(bool previewUrl)
|
||||
{
|
||||
// Arrange
|
||||
var content = new TextMessageContent("Hello, World!");
|
||||
content.Body.PreviewUrl = previewUrl;
|
||||
|
||||
// Act
|
||||
bool isValid = content.IsValid();
|
||||
|
||||
// Assert
|
||||
Assert.IsTrue(isValid);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[DataRow(null)]
|
||||
[DataRow("")]
|
||||
[DataRow(" ")]
|
||||
public void ShouldValidateNotSuccessful(string text)
|
||||
{
|
||||
// Arrange
|
||||
var content = new TextMessageContent(text);
|
||||
|
||||
// Act
|
||||
bool isValid = content.IsValid();
|
||||
|
||||
// Assert
|
||||
Assert.IsFalse(isValid);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user