Skip to content

Commit b744691

Browse files
committed
feat(api): Updated intg testing for GetChannelAync
1 parent 4e1b6c3 commit b744691

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Kepware.Api.TestIntg/ApiClient/ProjectApiHandlerTests.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,39 @@ public async Task GetOrCreateChannelAsync_ShouldCreateChannel_WhenChannelDoesNot
5757
await DeleteAllChannelsAsync();
5858
}
5959

60+
[Fact]
61+
public async Task GetChannelAsync_ShouldReturnChannel_WhenChannelExists()
62+
{
63+
// Arrange
64+
var channel = await AddTestChannel();
65+
66+
// Act
67+
var result = await _projectApiHandler.Channels.GetChannelAsync(channel.Name);
68+
69+
// Assert
70+
Assert.NotNull(result);
71+
Assert.Equal(channel.Name, result.Name);
72+
73+
// Clean up
74+
await DeleteAllChannelsAsync();
75+
}
76+
77+
[Fact]
78+
public async Task GetChannelAsync_ShouldCreateChannel_WhenChannelDoesNotExist()
79+
{
80+
// Arrange
81+
var channel = CreateTestChannel();
82+
83+
// Act
84+
var result = await _projectApiHandler.Channels.GetChannelAsync(channel.Name);
85+
86+
// Assert
87+
Assert.Null(result);
88+
89+
// Clean up
90+
await DeleteAllChannelsAsync();
91+
}
92+
6093
[Fact]
6194
public async Task UpdateChannelAsync_ShouldReturnTrue_WhenUpdateIsSuccessful()
6295
{

0 commit comments

Comments
 (0)