软件工程第二次作业

与vs官网对visualstudio2017进行了下载
VS官网下载地址
随后进行安装



打开vs

创建C#类库

将测试用例输入
测试用例:

namespace DemoUser
{
    public class User
    {
        public User(string userEmail)
        {
            m_email = userEmail;
        }
        private string m_email; //user email as user id
    }   
}


单元测试代码

 [TestMethod()]
        public void ConstructorTest()
        {
            string userEmail = "someone@somewhere.com";
 
            User target = new User(userEmail);
 
            Assert.IsTrue(target != null);
        }

测试通过

posted @ 2018-03-21 15:21  苍颜青灯  阅读(114)  评论(0编辑  收藏  举报