File tree Expand file tree Collapse file tree
tests/PromptStream.AI.Tests/Integration Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using System ;
2+ using PromptStream . AI . Integration . TokenFlow . Services ;
3+ using TokenFlow . Core . Models ;
4+ using Xunit ;
5+
6+ namespace PromptStream . AI . Tests . Integration
7+ {
8+ public class TokenFlowPromptProviderTests
9+ {
10+ [ Fact ]
11+ public void GetModel_ShouldReturnModel_WhenModelExists ( )
12+ {
13+ // Act
14+ var model = TokenFlowPromptProvider . GetModel ( "gpt-4o" ) ;
15+
16+ // Assert
17+ Assert . NotNull ( model ) ;
18+ Assert . Equal ( "gpt-4o" , model . Id ) ;
19+ Assert . Equal ( "OpenAI" , model . Family ) ;
20+ Assert . True ( model . InputPricePer1K > 0 ) ;
21+ Assert . True ( model . OutputPricePer1K > 0 ) ;
22+ }
23+
24+ [ Fact ]
25+ public void GetModel_ShouldThrow_WhenModelDoesNotExist ( )
26+ {
27+ // Arrange
28+ var invalidModelId = "nonexistent-model" ;
29+
30+ // Act & Assert
31+ var ex = Assert . Throws < InvalidOperationException > ( ( ) =>
32+ TokenFlowPromptProvider . GetModel ( invalidModelId ) ) ;
33+
34+ Assert . Contains ( "Model not found" , ex . Message ) ;
35+ }
36+ }
37+ }
38+
You can’t perform that action at this time.
0 commit comments