📄 testpaperstrategy.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using ExaminationSystem.BLL.Domain;
namespace ExaminationSystem.Test.Domain
{
[TestFixture]
public class TestPaperStrategy
{
[Test]
public void TestGetPaper()
{
StrategyItem danxuan = new StrategyItem();
danxuan.QuestionContents.Add(TestGlobal.DanXuanContent1);
danxuan.QuestionContents.Add(TestGlobal.DanXuanContent2);
danxuan.Count = 1;
danxuan.ScoreValue = 2;
StrategyItem duoxuan = new StrategyItem();
duoxuan.QuestionContents.Add(TestGlobal.DuoXuanContent1);
duoxuan.QuestionContents.Add(TestGlobal.DuoXuanContent2);
duoxuan.Count = 1;
duoxuan.ScoreValue = 2;
StrategyItem panduan = new StrategyItem();
panduan.QuestionContents.Add(TestGlobal.PanDuanContent1);
panduan.QuestionContents.Add(TestGlobal.PanDuanContent2);
panduan.Count = 1;
panduan.ScoreValue = 2;
StrategyItem tiankong = new StrategyItem();
tiankong.QuestionContents.Add(TestGlobal.TianKongContent1);
tiankong.QuestionContents.Add(TestGlobal.TianKongContent2);
tiankong.Count = 1;
tiankong.ScoreValue = 2;
StrategyItem jianda = new StrategyItem();
jianda.QuestionContents.Add(TestGlobal.JianDaContent1);
jianda.QuestionContents.Add(TestGlobal.JianDaContent2);
jianda.Count = 1;
jianda.ScoreValue = 2;
StrategyContainer danxuans = new StrategyContainer();
danxuans.Title = "单选题";
danxuans.AddStrategyItem(danxuan);
StrategyContainer duoxuans = new StrategyContainer();
duoxuans.Title = "多选题";
duoxuans.AddStrategyItem(duoxuan);
StrategyContainer panduans = new StrategyContainer();
panduans.Title = "判断题";
panduans.AddStrategyItem(panduan);
StrategyContainer tiankongs = new StrategyContainer();
tiankongs.Title = "填空题";
tiankongs.AddStrategyItem(tiankong);
StrategyContainer jiandas = new StrategyContainer();
jiandas.Title = "简答题";
jiandas.AddStrategyItem(jianda);
PaperStrategy paperstrategy = new PaperStrategy();
paperstrategy.AddStrategyContainer(danxuans);
paperstrategy.AddStrategyContainer(duoxuans);
paperstrategy.AddStrategyContainer(panduans);
paperstrategy.AddStrategyContainer(tiankongs);
paperstrategy.AddStrategyContainer(jiandas);
Paper paper = paperstrategy.GetCurrentPaper();
paper.Student = TestGlobal.Student1;
paper.Examination = TestGlobal.Examination1;
Console.Write(paper.GetPaperXML());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -