Skip to content

Commit a384e98

Browse files
authored
Merge pull request #64 from Bandwidth/DX-3105
DX-3105 Update Tests to Target .NET 6 & 7
2 parents 59e11e8 + 9a4e8ef commit a384e98

File tree

7 files changed

+25
-26
lines changed

7 files changed

+25
-26
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
runs-on: ${{ matrix.os }}
1616
strategy:
1717
matrix:
18-
os: [windows-2022, windows-2019, ubuntu-18.04, ubuntu-20.04]
19-
dotnet: [3.1.x, 5.0.x]
18+
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
19+
dotnet: [6.0.x, 7.0.x]
2020
steps:
2121
- name: Checkout repo
2222
uses: actions/checkout@v2

Bandwidth.Standard/Voice/Bxml/StartStream.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ public StartStream()
1919
{
2020
StreamParams = new List<StreamParam>();
2121
}
22-
22+
2323
/// <summary>
2424
/// A websocket URI to send the stream to
2525
/// </summary>
2626
public string Destination { get; set; }
27-
27+
2828
/// <summary>
2929
/// A name to refer to this stream by
3030
/// </summary>
@@ -39,7 +39,7 @@ public StartStream()
3939
/// URL to send the associated Webhook events to during this stream's lifetime
4040
/// </summary>
4141
public string StreamEventUrl { get; set; }
42-
42+
4343
/// <summary>
4444
/// The HTTP method to use for the request to `streamEventUrl`
4545
/// </summary>
@@ -54,7 +54,7 @@ public StartStream()
5454
/// The password to send in the HTTP request to `streamEventUrl`
5555
/// </summary>
5656
public string Password { get; set; }
57-
57+
5858
/// <summary>
5959
/// List of StreamParam verbs
6060
/// </summary>
@@ -101,10 +101,9 @@ void IXmlSerializable.WriteXml(XmlWriter writer)
101101
{
102102
var ns = new XmlSerializerNamespaces();
103103
ns.Add("", "");
104-
104+
105105
foreach (var verb in StreamParams)
106106
{
107-
Console.WriteLine(verb.Name);
108107
var serializer = new XmlSerializer(verb.GetType(), "");
109108
serializer.Serialize(writer, verb, ns);
110109
}

Bandwidth.StandardTests/Bandwidth.StandardTests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework Condition="'$(DOTNET)' == '3.1.x' Or '$(DOTNET)' == ''">netcoreapp3.1</TargetFramework>
5-
<TargetFramework Condition="'$(DOTNET)' == '5.0.x'">net5.0</TargetFramework>
4+
<TargetFramework Condition="'$(DOTNET)' == '6.0.x' Or '$(DOTNET)' == ''">net6.0</TargetFramework>
5+
<TargetFramework Condition="'$(DOTNET)' == '7.0.x'">net7.0</TargetFramework>
66

77
<IsPackable>false</IsPackable>
88
</PropertyGroup>

Bandwidth.StandardTests/Voice/Bxml/BxmlTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ public class BxmlTests
1010
public void EmptyBxmlTest()
1111
{
1212
var bxml = new BXML();
13-
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Bxml />", bxml.ToBXML());
13+
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Bxml />", bxml.ToBXML().Replace("\n", "").Replace("\r", ""));
1414
}
15-
15+
1616
[Fact]
1717
public void RingAnswerCallResponseToBXMLShouldBeFalse()
1818
{
@@ -21,7 +21,7 @@ public void RingAnswerCallResponseToBXMLShouldBeFalse()
2121

2222
var bxml = new BXML(ring);
2323

24-
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Bxml> <Ring duration=\"5\" answerCall=\"false\" /></Bxml>", bxml.ToBXML());
24+
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Bxml> <Ring duration=\"5\" answerCall=\"false\" /></Bxml>", bxml.ToBXML().Replace("\n", "").Replace("\r", ""));
2525
}
2626
}
2727
}

Bandwidth.StandardTests/Voice/Bxml/RingTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public void RingResponseToBXMLShouldBeDefaults()
3838
var ring = new Ring();
3939
var response = new Response(ring);
4040

41-
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Response> <Ring duration=\"5\" answerCall=\"true\" /></Response>", response.ToBXML());
41+
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Response> <Ring duration=\"5\" answerCall=\"true\" /></Response>", response.ToBXML().Replace("\n", "").Replace("\r", ""));
4242
}
4343

4444
[Fact]
@@ -49,7 +49,7 @@ public void RingDurationResponseToBXMLShouldBeThirty()
4949

5050
var response = new Response(ring);
5151

52-
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Response> <Ring duration=\"30\" answerCall=\"true\" /></Response>", response.ToBXML());
52+
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Response> <Ring duration=\"30\" answerCall=\"true\" /></Response>", response.ToBXML().Replace("\n", "").Replace("\r", ""));
5353
}
5454

5555
[Fact]
@@ -60,7 +60,7 @@ public void RingAnswerCallResponseToBXMLShouldBeFalse()
6060

6161
var response = new Response(ring);
6262

63-
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Response> <Ring duration=\"5\" answerCall=\"false\" /></Response>", response.ToBXML());
63+
Assert.Equal("<?xml version=\"1.0\" encoding=\"utf-8\"?><Response> <Ring duration=\"5\" answerCall=\"false\" /></Response>", response.ToBXML().Replace("\n", "").Replace("\r", ""));
6464
}
6565
}
66-
}
66+
}

Bandwidth.StandardTests/Voice/Bxml/StreamTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class StreamTests
1111
public void StartStreamBxmlVerbTest()
1212
{
1313
var expected = "<?xml version=\"1.0\" encoding=\"utf-8\"?><Response> <StartStream destination=\"https://www.test.com/stream\" name=\"test_stream\" tracks=\"inbound\" streamEventUrl=\"https://www.test.com/event\" streamEventMethod=\"POST\" username=\"username\" password=\"password\"> <StreamParam name=\"name1\" value=\"value1\" /> <StreamParam name=\"name2\" value=\"value2\" /> </StartStream></Response>";
14-
14+
1515
var streamParam1 = new StreamParam();
1616
streamParam1.Name = "name1";
1717
streamParam1.Value = "value1";
@@ -34,9 +34,9 @@ public void StartStreamBxmlVerbTest()
3434
var response = new Response(startStream);
3535
var actual = response.ToBXML();
3636

37-
Assert.Equal(expected, actual);
37+
Assert.Equal(expected, actual.Replace("\n", "").Replace("\r", ""));
3838
}
39-
39+
4040
[Fact]
4141
public void StopStreamBxmlVerbTest()
4242
{
@@ -47,7 +47,7 @@ public void StopStreamBxmlVerbTest()
4747
var response = new Response(stopStream);
4848
var actual = response.ToBXML();
4949

50-
Assert.Equal(expected, actual);
50+
Assert.Equal(expected, actual.Replace("\n", "").Replace("\r", ""));
5151
}
5252
}
5353
}

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
| **OS** | **.NET** |
66
|:---:|:---:|
7-
| Windows 2016 | Core 3.1, 5.0 |
8-
| Windows 2019 | Core 3.1, 5.0 |
9-
| Ubuntu 18.04 | Core 3.1, 5.0 |
10-
| Ubuntu 20.04 | Core 3.1, 5.0 |
7+
| Windows 2019 | Core 3.1, 6.0 |
8+
| Windows 2022 | Core 3.1, 7.0 |
9+
| Ubuntu 20.04 | Core 3.1, 6.0 |
10+
| Ubuntu 22.04 | Core 3.1, 7.0 |
1111

1212
## Getting Started
1313

@@ -88,7 +88,7 @@ response.ToBXML();
8888

8989
### Update an Existing Calls BXML
9090

91-
```csharp
91+
```csharp
9292
using Bandwidth.Standard;
9393
using Bandwidth.Standard.Voice.Bxml;
9494

0 commit comments

Comments
 (0)