Skip to content

Commit e1caf42

Browse files
author
AndrewMorgan1
committed
expanded TokenFlowPromptProviderTests
1 parent 8f6481e commit e1caf42

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+

0 commit comments

Comments
 (0)