Skip to content

Commit

Permalink
fix: set StartOnEnter default value to true for ConversationAction
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed May 7, 2024
1 parent 3051a53 commit 80a39b1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
33 changes: 19 additions & 14 deletions Vonage.Test/NccoTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using FluentAssertions;
using Newtonsoft.Json;
using Vonage.Serialization;
using Vonage.Voice;
Expand All @@ -22,7 +23,7 @@ public void TestAppEndpoint()
Assert.Equal(expectedJson,
JsonConvert.SerializeObject(endpoint, VonageSerialization.SerializerSettings));
}

[Fact]
public void TestConnect()
{
Expand Down Expand Up @@ -55,7 +56,7 @@ public void TestConnect()
var actualJson = ncco.ToString();
Assert.Equal(expectedJson, actualJson);
}

[Fact]
public void TestConnectWithAdvancedMachineDetection()
{
Expand Down Expand Up @@ -88,7 +89,7 @@ public void TestConnectWithAdvancedMachineDetection()
};
Assert.Equal(this.GetRequestJson(), new Ncco(connectAction).ToString());
}

[Fact]
public void TestConversation()
{
Expand All @@ -107,7 +108,7 @@ public void TestConversation()
var actualJson = ncco.ToString();
Assert.Equal(expectedJson, actualJson);
}

[Fact]
public void TestConversationAllTrue()
{
Expand All @@ -126,7 +127,11 @@ public void TestConversationAllTrue()
var actualJson = ncco.ToString();
Assert.Equal(expectedJson, actualJson);
}


[Fact]
public void ConversationAction_StartOnEnter_ShouldBeTrue_GivenDefault() =>
new ConversationAction().StartOnEnter.Should().BeTrue();

[Fact]
public void TestNotify()
{
Expand All @@ -144,7 +149,7 @@ public void TestNotify()
var actualJson = ncco.ToString();
Assert.Equal(expectedJson, actualJson);
}

[Theory]
[InlineData(RecordAction.AudioFormat.Mp3)]
[InlineData(RecordAction.AudioFormat.Wav)]
Expand All @@ -170,7 +175,7 @@ public void TestRecord(RecordAction.AudioFormat audioFormat)
var actualJson = ncco.ToString();
Assert.Equal(expectedJson, actualJson);
}

[Fact]
public void TestRecordMinimalist()
{
Expand All @@ -180,7 +185,7 @@ public void TestRecordMinimalist()
var actualJson = ncco.ToString();
Assert.Equal(expectedJson, actualJson);
}

[Fact]
public void TestSipEndpoint()
{
Expand All @@ -193,7 +198,7 @@ public void TestSipEndpoint()
Assert.Equal(expectedJson,
JsonConvert.SerializeObject(endpoint, VonageSerialization.SerializerSettings));
}

[Fact]
public void TestStream()
{
Expand All @@ -209,7 +214,7 @@ public void TestStream()
var actualJson = ncco.ToString();
Assert.Equal(expectedJson, actualJson);
}

[Fact]
public void TestTalk()
{
Expand All @@ -227,7 +232,7 @@ public void TestTalk()
var actualJson = ncco.ToString();
Assert.Equal(expectedJson, actualJson);
}

[Fact]
public void TestTalkBareBones()
{
Expand All @@ -240,7 +245,7 @@ public void TestTalkBareBones()
var actualJson = ncco.ToString();
Assert.Equal(expectedJson, actualJson);
}

[Fact]
public void TestVbcEndpoint()
{
Expand All @@ -252,7 +257,7 @@ public void TestVbcEndpoint()
Assert.Equal(expectedJson,
JsonConvert.SerializeObject(endpoint, VonageSerialization.SerializerSettings));
}

[Fact]
public void TestWebsocketEndpoint()
{
Expand All @@ -266,7 +271,7 @@ public void TestWebsocketEndpoint()
Assert.Equal(expectedJson,
JsonConvert.SerializeObject(endpoint, VonageSerialization.SerializerSettings));
}

private class TestClass
{
public string Bar { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion Vonage/Voice/Nccos/ConversationAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ public class ConversationAction : NccoAction
/// joins conversation name. Set to false for attendees in a moderated conversation.
/// </summary>
[JsonProperty("startOnEnter", DefaultValueHandling = DefaultValueHandling.Include, Order = 3)]
public bool StartOnEnter { get; set; }
public bool StartOnEnter { get; set; } = true;
}

0 comments on commit 80a39b1

Please sign in to comment.