Skip to content

Commit 2295439

Browse files
refactor: introduced SinchUrlResolversTests and consolidated all resolver tests there, moving them out of the per-service *ConfigurationTests files
1 parent 2496423 commit 2295439

10 files changed

Lines changed: 334 additions & 399 deletions

tests/Sinch.Tests/AuthConfigurationTests.cs

Lines changed: 0 additions & 39 deletions
This file was deleted.

tests/Sinch.Tests/Conversation/ConversationConfigurationTests.cs

Lines changed: 0 additions & 70 deletions
This file was deleted.

tests/Sinch.Tests/Conversation/ConversationsTests.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
using System;
12
using System.Text.Json.Nodes;
23
using FluentAssertions;
4+
using Sinch.Conversation;
35
using Xunit;
46

57
namespace Sinch.Tests.Conversation
@@ -36,5 +38,25 @@ public void UpdateMaskConversationOnlyOneField()
3638
conversation.GetPropertiesMask().Should().BeEquivalentTo(
3739
"app_id");
3840
}
41+
42+
[Fact]
43+
public void Validate_ThrowsWhenRegionNotSet()
44+
{
45+
var client = new SinchClient(new SinchClientConfiguration());
46+
var act = () => client.Conversation;
47+
act.Should().Throw<InvalidOperationException>()
48+
.WithMessage("*Region*required*");
49+
}
50+
51+
[Fact]
52+
public void Validate_DoesNotThrow_WhenRegionIsSet()
53+
{
54+
var client = new SinchClient(new SinchClientConfiguration
55+
{
56+
ConversationConfiguration = new SinchConversationConfiguration { Region = ConversationRegion.Us }
57+
});
58+
var act = () => client.Conversation;
59+
act.Should().NotThrow<InvalidOperationException>();
60+
}
3961
}
4062
}

tests/Sinch.Tests/Fax/FaxConfigurationTests.cs

Lines changed: 0 additions & 52 deletions
This file was deleted.

tests/Sinch.Tests/Numbers/NumbersConfigurationTests.cs

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)