Revize c9ac14ff
Přidáno uživatelem Eliška Mourycová před téměř 4 roky(ů)
Server/ServerApp/server_config | ||
---|---|---|
1 | 1 |
# |
2 | 2 |
# Tri Musketyri, ASWI 2021 |
3 | 3 |
# This is the server configuration file. See the documentation for detailed information about its structure. |
4 |
# Pass this file as an argument to the server program when launching it. |
|
4 |
# Pass the path to this file as an argument to the server program when launching it.
|
|
5 | 5 |
# |
6 | 6 |
|
7 | 7 |
# --- DATA FILES DOWNLOADING CONFIGURATION --- |
Server/ServerAppFunctionalTests/DownloaderTests/DataDownloaderTesting.cs | ||
---|---|---|
1 |
using Microsoft.VisualStudio.TestTools.UnitTesting; |
|
2 |
using ServerApp.DataDownload; |
|
3 |
using System; |
|
4 |
using System.Collections.Generic; |
|
5 |
using System.IO; |
|
6 |
using System.Linq; |
|
7 |
using System.Text; |
|
8 |
using System.Threading.Tasks; |
|
9 |
|
|
10 |
namespace ServerAppFunctionalTests.DownloaderTests |
|
11 |
{ |
|
12 |
[TestClass] |
|
13 |
public class DataDownloaderTesting |
|
14 |
{ |
|
15 |
static DataDownloader dd; |
|
16 |
[ClassInitialize] |
|
17 |
public static void SetUpClass(TestContext context) |
|
18 |
{ |
|
19 |
dd = new DataDownloader("./testDD", "http://openstore.zcu.cz/", "OD_ZCU_{type}_{month}_{year}_{format}.zip", "http://wttr.in/Plzen,czechia?format=j1"); ; |
|
20 |
} |
|
21 |
|
|
22 |
[TestMethod] |
|
23 |
public void DirectoryCreated() |
|
24 |
{ |
|
25 |
dd = new DataDownloader("./testDD", "http://openstore.zcu.cz/", "OD_ZCU_{type}_{month}_{year}_{format}.zip", "http://wttr.in/Plzen,czechia?format=j1"); |
|
26 |
bool rootDirExists = Directory.Exists(dd.RootDataDirectory); |
|
27 |
Assert.IsTrue(rootDirExists); |
|
28 |
} |
|
29 |
|
|
30 |
[TestMethod] |
|
31 |
public void DataSubdirectoriesCreated() |
|
32 |
{ |
|
33 |
|
|
34 |
} |
|
35 |
|
|
36 |
[TestMethod] |
|
37 |
public void DataDownload() |
|
38 |
{ |
|
39 |
|
|
40 |
} |
|
41 |
|
|
42 |
[TestMethod] |
|
43 |
public void DataRetrieve() |
|
44 |
{ |
|
45 |
|
|
46 |
} |
|
47 |
|
|
48 |
[TestMethod] |
|
49 |
public void DateCompare() |
|
50 |
{ |
|
51 |
|
|
52 |
} |
|
53 |
} |
|
54 |
} |
Server/ServerAppFunctionalTests/Predictor/PredictionControllerTests.cs | ||
---|---|---|
24 | 24 |
public void PredictSingleTimeWeatherTest() |
25 | 25 |
{ |
26 | 26 |
System.IO.Directory.CreateDirectory(@".\data"); |
27 |
DataDownloader dd = new DataDownloader(@".\data\dd\", "http://openstore.zcu.cz/", "OD_ZCU_{type}_{month}_{year}_{format}.zip"); |
|
27 |
DataDownloader dd = new DataDownloader(@".\data\dd\", "http://openstore.zcu.cz/", "OD_ZCU_{type}_{month}_{year}_{format}.zip", "http://wttr.in/Plzen,czechia?format=j1");
|
|
28 | 28 |
PredictionController instance = new PredictionController(new JsonParser(dd, new CsvDataLoader()), new DataParser(dd)); |
29 | 29 |
|
30 | 30 |
dd.DownloadData(DataType.JIS, DataFormat.CSV, new DataDownload.Date(1, 2019), new DataDownload.Date(12, 2020)); |
Server/ServerAppFunctionalTests/TestingDataDownloader.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
using Microsoft.VisualStudio.TestTools.UnitTesting; |
|
7 |
|
|
8 |
namespace ServerAppFunctionalTests |
|
9 |
{ |
|
10 |
[TestClass] |
|
11 |
class TestingDataDownloader |
|
12 |
{ |
|
13 |
[TestMethod] |
|
14 |
public void DataDirectoryCreate() |
|
15 |
{ |
|
16 |
|
|
17 |
} |
|
18 |
|
|
19 |
[TestMethod] |
|
20 |
public void DataSubdirectoriesCreate() |
|
21 |
{ |
|
22 |
|
|
23 |
} |
|
24 |
|
|
25 |
[TestMethod] |
|
26 |
public void DataDownload() |
|
27 |
{ |
|
28 |
|
|
29 |
} |
|
30 |
|
|
31 |
[TestMethod] |
|
32 |
public void DataRetrieve() |
|
33 |
{ |
|
34 |
|
|
35 |
} |
|
36 |
|
|
37 |
[TestMethod] |
|
38 |
public void DateCompare() |
|
39 |
{ |
|
40 |
|
|
41 |
} |
|
42 |
} |
|
43 |
} |
Také k dispozici: Unified diff
Re #9051. Prepared for testing.