Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 40ad766d62 | |||
| 3ac291c693 |
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using Xunit;
|
||||
|
||||
namespace QuantEngine.Core.Tests
|
||||
{
|
||||
public class BffApiTests
|
||||
{
|
||||
[Fact]
|
||||
public void UpdateFactorThreshold_ValidJson_ParsesCorrectly()
|
||||
{
|
||||
// Arrange
|
||||
var jsonString = "{\"momentum_lookback\": 20, \"volatility_cap\": 0.05}";
|
||||
|
||||
// Act
|
||||
using var doc = JsonDocument.Parse(jsonString);
|
||||
var root = doc.RootElement;
|
||||
var lookback = root.GetProperty("momentum_lookback").GetInt32();
|
||||
var cap = root.GetProperty("volatility_cap").GetDouble();
|
||||
|
||||
// Assert
|
||||
Assert.Equal(20, lookback);
|
||||
Assert.Equal(0.05, cap);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ExportStreamingFactorOlap_WriteCsvRow_MatchesExpectedFormat()
|
||||
{
|
||||
// Arrange
|
||||
var sb = new StringBuilder();
|
||||
var headers = new[] { "ticker", "as_of_date", "close_price", "nav_price" };
|
||||
sb.AppendLine(string.Join(",", headers));
|
||||
|
||||
var row = new object[] { "123456", "2026-07-25", 50000, 49800 };
|
||||
sb.AppendLine(string.Join(",", row));
|
||||
|
||||
// Act
|
||||
var output = sb.ToString();
|
||||
|
||||
// Assert
|
||||
Assert.Contains("ticker,as_of_date,close_price,nav_price", output);
|
||||
Assert.Contains("123456,2026-07-25,50000,49800", output);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BulkInsertMarketExcel_EmptyCellValidation_DetectsNull()
|
||||
{
|
||||
// Arrange
|
||||
string? ticker = null;
|
||||
double? price = null;
|
||||
|
||||
|
||||
// Act
|
||||
bool isInvalid = string.IsNullOrEmpty(ticker) || !price.HasValue;
|
||||
|
||||
// Assert
|
||||
Assert.True(isInvalid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,8 @@
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vue-tsc -b && vite build",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"test": "vitest run"
|
||||
},
|
||||
"dependencies": {
|
||||
"@primevue/themes": "^4.3.1",
|
||||
@@ -21,9 +22,13 @@
|
||||
"devDependencies": {
|
||||
"@types/node": "^24.13.2",
|
||||
"@vitejs/plugin-vue": "^6.0.7",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"@vue/tsconfig": "^0.9.1",
|
||||
"jsdom": "^26.0.0",
|
||||
"typescript": "~6.0.2",
|
||||
"vite": "^8.1.1",
|
||||
"vitest": "^3.0.4",
|
||||
"vue-tsc": "^3.3.5"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { mount } from '@vue/test-utils';
|
||||
import TemplateGalleryView from '../TemplateGalleryView.vue';
|
||||
import RealOlapExportLayout from '../RealOlapExportLayout.vue';
|
||||
|
||||
describe('Prototype Template UI Rendering Tests', () => {
|
||||
it('TemplateGalleryView should render all 9 template options', () => {
|
||||
const wrapper = mount(TemplateGalleryView, {
|
||||
global: {
|
||||
stubs: {
|
||||
'router-link': true
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 갤러리 타이틀 렌더링 검증
|
||||
expect(wrapper.text()).toContain('상용화 프로토타입 템플릿 갤러리');
|
||||
|
||||
// 9개의 카드 목록 카운트 검증 (가이드라인 준수)
|
||||
const cards = wrapper.findAll('router-link-stub');
|
||||
expect(cards.length).toBe(9);
|
||||
});
|
||||
|
||||
it('RealOlapExportLayout should render action button', () => {
|
||||
const wrapper = mount(RealOlapExportLayout);
|
||||
|
||||
// 엑셀 보고서 출력 버튼이 정상적으로 노출되는지 검증
|
||||
expect(wrapper.find('button').text()).toContain('엑셀 보고서 출력');
|
||||
expect(wrapper.text()).toContain('다차원 팩터 출력 리포트');
|
||||
});
|
||||
});
|
||||
@@ -4,6 +4,10 @@ import vue from '@vitejs/plugin-vue'
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
globals: true
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
proxy: {
|
||||
@@ -15,3 +19,4 @@ export default defineConfig({
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user