📄 testabstractservice.cs
字号:
using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using ExaminationSystem.BLL.Domain;
using ExaminationSystem.BLL.Service;
namespace ExaminationSystem.Test.BLL
{
[TestFixture]
public class TestAbstractService
{
[Test]
public void TestGetById()
{
Class cs =new ClassService().GetById(1);
Console.Write(cs.Name);
Assert.IsTrue(cs.Name.Length > 0);
}
[Test]
public void TestSave()
{
Class cs = new Class();
cs.Name = "testsave";
new ClassService().Save(cs);
Assert.IsTrue(cs.ID > 0);
}
[Test]
public void TestGetByExample()
{
Class cs = new Class();
cs.Name = "testsave";
IList<Class> classes =new ClassService().GetByExample(cs);
Assert.IsTrue(classes.Count == 2);
}
[Test]
public void TestGetUniqueExample()
{
Class cs = new Class();
cs.Name = "testsave1";
Class classes =new ClassService().GetUniqueByExample(cs);
Assert.IsTrue(classes.ID>1);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -