1
0
Files
LinkMobility/test/LinkMobility.Tests/WhatsApp/Contents/TextMessageContentTest.cs
Andreas Müller 6b5581c247
All checks were successful
Branch Build / build-test-deploy (push) Successful in 1m23s
Added basic WhatsApp implementation
2026-03-24 20:06:55 +01:00

41 lines
754 B
C#

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);
}
}
}