Skip to content

Commit

Permalink
fix: add missing comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
Dovchik committed Dec 27, 2024
1 parent 3b83d2e commit b04ba01
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Sinch/Conversation/SinchConversationClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public interface ISinchConversation
/// <inheritdoc cref="ISinchConversationTemplatesV2" />
ISinchConversationTemplatesV2 TemplatesV2 { get; }

/// <inheritdoc cref="ISinchConversationTemplatesV1" />
ISinchConversationTemplatesV1 TemplatesV1 { get; }
}

Expand Down
52 changes: 51 additions & 1 deletion tests/Sinch.Tests/e2e/Conversation/TemplatesV1Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,53 @@ public async Task Update()
},
}
});

response.Should().BeEquivalentTo(new Template()
{
Id = "01W4FFL35P4NC4K35TEMPLATE01",
Description = "Updated text template V1",
DefaultTranslation = "fr-FR",
Channel = TemplateChannel.Unspecfied,
CreateTime = Helpers.ParseUtc("2024-06-06T14:42:42Z"),
UpdateTime = Helpers.ParseUtc("2024-06-06T14:45:45Z"),
Translations = new List<TemplateTranslation>()
{
new TemplateTranslation()
{
LanguageCode = "en-US",
Version = "2",
Content =
"{\"text_message\":{\"text\":\"Hello ${name}. This text message template has been created with V1 API\"}}",
Variables = new List<TypeTemplateVariable>()
{
new TypeTemplateVariable()
{
Key = "name",
PreviewValue = "Professor Jones"
}
},
CreateTime = Helpers.ParseUtc("2024-06-06T14:45:45Z"),
UpdateTime = Helpers.ParseUtc("2024-06-06T14:45:45Z"),
},
new TemplateTranslation()
{
LanguageCode = "fr-FR",
Version = "1",
Content =
"{\"text_message\":{\"text\":\"Bonjour ${name}. Ce message texte provient d'un template V1\"}}",
Variables = new List<TypeTemplateVariable>()
{
new TypeTemplateVariable()
{
Key = "name",
PreviewValue = "Professeur Jones"
}
},
CreateTime = Helpers.ParseUtc("2024-06-06T14:45:45Z"),
UpdateTime = Helpers.ParseUtc("2024-06-06T14:45:45Z"),
},
}
});
}

[Fact]
Expand All @@ -143,7 +190,8 @@ public async Task Create()
{
LanguageCode = "en-US",
Version = "1",
Content = "{\"text_message\":{\"text\":\"Hello ${name}. Text message template created with V1 API\"}}",
Content =
"{\"text_message\":{\"text\":\"Hello ${name}. Text message template created with V1 API\"}}",
Variables = new List<TypeTemplateVariable>()
{
new TypeTemplateVariable()
Expand All @@ -155,6 +203,8 @@ public async Task Create()
}
}
});

template.Should().BeEquivalentTo(_template);
}
}
}

0 comments on commit b04ba01

Please sign in to comment.