+
- }/>
- }/>
+ }/>
+ }/>
);
diff --git a/MyNUnitWeb/mynunitweb.front/src/api/api.ts b/MyNUnitWeb/mynunitweb.front/src/api/api.ts
index 98d142f..ca28ef5 100644
--- a/MyNUnitWeb/mynunitweb.front/src/api/api.ts
+++ b/MyNUnitWeb/mynunitweb.front/src/api/api.ts
@@ -20,6 +20,7 @@ if (typeof URLSearchParams === 'undefined'){
URLSearchParams = require('url').URLSearchParams;
}
+
const BASE_PATH = "/".replace(/\/+$/, "");
/**
@@ -274,20 +275,28 @@ export const TestsApiFetchParamCreator = function (configuration?: Configuration
return {
/**
*
+ * @param {Array
} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
- apiTestsTestHistoryGet(options: any = {}): FetchArgs {
- const localVarPath = `/api/Tests/testHistory`;
+ apiTestsTestBytesPost(body?: Array, options: any = {}): FetchArgs {
+ console.log(body)
+ const localVarPath = `/api/Tests/testBytes`;
const localVarUrlObj = url.parse(localVarPath, true);
- const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
+ const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
+ localVarHeaderParameter['Content-Type'] = 'application/json';
+
localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
delete localVarUrlObj.search;
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
+ const needsSerialization = ("Array<string>" !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
+ localVarRequestOptions.body = body
+
+ console.log(localVarRequestOptions.body)
return {
url: url.format(localVarUrlObj),
@@ -296,37 +305,27 @@ export const TestsApiFetchParamCreator = function (configuration?: Configuration
},
/**
*
- * @param {Array} [files]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
- apiTestsTestPost(files?: Array, options: any = {}): FetchArgs {
- const localVarPath = `/api/Tests/test`;
+ apiTestsTestHistoryGet(options: any = {}): FetchArgs {
+ const localVarPath = `/api/Tests/testHistory`;
const localVarUrlObj = url.parse(localVarPath, true);
- const localVarRequestOptions = Object.assign({ method: 'POST' }, options);
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, options);
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
- const localVarFormParams = new URLSearchParams();
-
- if (files) {
- files.forEach((element) => {
- localVarFormParams.append('files', element as any);
- })
- }
-
- localVarHeaderParameter['Content-Type'] = 'application/x-www-form-urlencoded';
localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
delete localVarUrlObj.search;
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
- localVarRequestOptions.body = localVarFormParams.toString();
return {
url: url.format(localVarUrlObj),
options: localVarRequestOptions,
};
},
+
}
};
@@ -338,11 +337,13 @@ export const TestsApiFp = function(configuration?: Configuration) {
return {
/**
*
+ * @param {Array} [body]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
- apiTestsTestHistoryGet(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise {
- const localVarFetchArgs = TestsApiFetchParamCreator(configuration).apiTestsTestHistoryGet(options);
+ apiTestsTestBytesPost(body?: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> {
+ console.log(body)
+ const localVarFetchArgs = TestsApiFetchParamCreator(configuration).apiTestsTestBytesPost(body, options);
return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
@@ -355,12 +356,11 @@ export const TestsApiFp = function(configuration?: Configuration) {
},
/**
*
- * @param {Array} [files]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
- apiTestsTestPost(files?: Array, options?: any): (fetch?: FetchAPI, basePath?: string) => Promise> {
- const localVarFetchArgs = TestsApiFetchParamCreator(configuration).apiTestsTestPost(files, options);
+ apiTestsTestHistoryGet(options?: any): (fetch?: FetchAPI, basePath?: string) => Promise {
+ const localVarFetchArgs = TestsApiFetchParamCreator(configuration).apiTestsTestHistoryGet(options);
return (fetch: FetchAPI = portableFetch, basePath: string = BASE_PATH) => {
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
if (response.status >= 200 && response.status < 300) {
@@ -371,6 +371,12 @@ export const TestsApiFp = function(configuration?: Configuration) {
});
};
},
+ /**
+ *
+ * @param {Array} [files]
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ */
}
};
@@ -380,6 +386,15 @@ export const TestsApiFp = function(configuration?: Configuration) {
*/
export const TestsApiFactory = function (configuration?: Configuration, fetch?: FetchAPI, basePath?: string) {
return {
+ /**
+ *
+ * @param {Array} [body]
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ */
+ apiTestsTestBytesPost(body?: Array, options?: any) {
+ return TestsApiFp(configuration).apiTestsTestBytesPost(body, options)(fetch, basePath);
+ },
/**
*
* @param {*} [options] Override http request option.
@@ -394,9 +409,6 @@ export const TestsApiFactory = function (configuration?: Configuration, fetch?:
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
- apiTestsTestPost(files?: Array, options?: any) {
- return TestsApiFp(configuration).apiTestsTestPost(files, options)(fetch, basePath);
- },
};
};
@@ -407,6 +419,18 @@ export const TestsApiFactory = function (configuration?: Configuration, fetch?:
* @extends {BaseAPI}
*/
export class TestsApi extends BaseAPI {
+ /**
+ *
+ * @param {Array} [body]
+ * @param {*} [options] Override http request option.
+ * @throws {RequiredError}
+ * @memberof TestsApi
+ */
+ public apiTestsTestBytesPost(body?: Array, options?: any) {
+ console.log(body)
+ return TestsApiFp(this.configuration).apiTestsTestBytesPost(body, options)(this.fetch, this.basePath);
+ }
+
/**
*
* @param {*} [options] Override http request option.
@@ -424,8 +448,4 @@ export class TestsApi extends BaseAPI {
* @throws {RequiredError}
* @memberof TestsApi
*/
- public apiTestsTestPost(files?: Array, options?: any) {
- return TestsApiFp(this.configuration).apiTestsTestPost(files, options)(this.fetch, this.basePath);
- }
-
}
diff --git a/MyNUnitWeb/mynunitweb.front/src/components/AddTests.tsx b/MyNUnitWeb/mynunitweb.front/src/components/AddTests.tsx
new file mode 100644
index 0000000..768b80d
--- /dev/null
+++ b/MyNUnitWeb/mynunitweb.front/src/components/AddTests.tsx
@@ -0,0 +1,33 @@
+import {TextField, Typography, Button, Grid} from "@mui/material"
+import ApiSingleton from "../api/ApiSingleton";
+import React from 'react'
+import { MuiFileInput } from 'mui-file-input';
+
+interface IAddFilesState {
+
+}
+
+export const AddTests = () => {
+
+ const [file, setFile] = React.useState(null)
+ const submitFiles = async (e: File[]) => {
+ const decoder = new TextDecoder("utf-8")
+
+ const temp: string[] = [];
+
+ console.log(temp)
+
+ e.forEach(async f => {
+ temp.push((decoder.decode(await f.arrayBuffer())))
+ })
+
+ ApiSingleton.testsApi.apiTestsTestBytesPost(temp);
+ }
+
+ return
+
+ Выберите .dll файлы сборок
+
+
+
+};
\ No newline at end of file
diff --git a/MyNUnitWeb/mynunitweb.front/src/components/Header.tsx b/MyNUnitWeb/mynunitweb.front/src/components/Header.tsx
index e05ad60..f41ead3 100644
--- a/MyNUnitWeb/mynunitweb.front/src/components/Header.tsx
+++ b/MyNUnitWeb/mynunitweb.front/src/components/Header.tsx
@@ -5,29 +5,31 @@ import {Link} from "react-router-dom";
export const Header: React.FC = () => {
return
-
-
-
+
+
+
+
MyNUnitWeb
-
-
-
-
- Тестирование
-
-
-
-
-
-
- История
-
-
+
+
+
+
+ Тестирование
+
+
+
+
+
+
+ История
+
+
+
-
-
+
+
};
\ No newline at end of file
diff --git a/MyNUnitWeb/mynunitweb.front/src/components/TestsHistory.tsx b/MyNUnitWeb/mynunitweb.front/src/components/TestsHistory.tsx
index d15243a..75c74d1 100644
--- a/MyNUnitWeb/mynunitweb.front/src/components/TestsHistory.tsx
+++ b/MyNUnitWeb/mynunitweb.front/src/components/TestsHistory.tsx
@@ -11,6 +11,8 @@ export const TestsHistory: React.FC = () => {
const [testHistory, setTestHistory] = useState({
testResults: undefined,
})
+
+ useEffect(() => {getTestHistory()}, [])
const getTestHistory = async () => {
const testHistory = await ApiSingleton.testsApi.apiTestsTestHistoryGet()
@@ -20,7 +22,7 @@ export const TestsHistory: React.FC = () => {
return
};
\ No newline at end of file
diff --git a/MyNUnitWeb/mynunitweb.front/src/components/TestsResult.tsx b/MyNUnitWeb/mynunitweb.front/src/components/TestsResult.tsx
index d221750..8e674d0 100644
--- a/MyNUnitWeb/mynunitweb.front/src/components/TestsResult.tsx
+++ b/MyNUnitWeb/mynunitweb.front/src/components/TestsResult.tsx
@@ -1,27 +1,49 @@
import { TreeView, TreeItem } from "@mui/x-tree-view"
import {AllFileTestResultsViewModel} from '../api'
import React, {useState, useEffect} from 'react';
+import {CheckCircle, Cancel, NotificationsPaused, Error} from '@mui/icons-material'
+import { Typography, Box } from '@mui/material'
interface ITestsResultProps {
- results: AllFileTestResultsViewModel,
+ results: AllFileTestResultsViewModel | undefined,
}
export const TestsResult: React.FC = (props) => {
- const fileTestResultsCount = props.results.fileTestResults!.length;
+ console.log(props)
+ let totalValue = 0;
return
+
- {props.results.fileTestResults!.map((fr, index) =>
-
+ {props.results?.fileTestResults?.map((fr, index) =>
+ Assembly: {fr.name} | {fr.testDuration} ms}
+ icon={fr.isIgnored ? : fr.isPassed ? : } >
{fr.classTestResults!.map((cr, crIndex) =>
-
+ Class: {cr.name} | Error Reason: {cr.validationErrors!.join(' | ')}
+ : Class: {cr.name} | {cr.testDuration} ms}
+ icon={cr.validationErrors != undefined
+ ?
+ : cr.isIgnored
+ ?
+ : cr.isPassed
+ ?
+ : } >
{cr.methodTestResults!.map((mr, mrIndex) =>
-
+ Test: {mr.name} | {mr.testDuration} ms
+ : Test: {mr.name} | {mr.testDuration} ms | Reason: {mr.isFailed ? mr.failReasons : mr.ignoredReason}}
+ icon={mr.isIgnored ? : mr.isPassed ? : } />
)}
)}
)}
+
}
\ No newline at end of file