File tree Expand file tree Collapse file tree
Kepware.Api.TestIntg/ApiClient Expand file tree Collapse file tree Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments