这个方法怎么测试
我想点按钮的时候测试一下下面这个方法看sqlMap 是否得到数据,怎么写测试代码呀,刚学.net不清楚,大家帮看看
#region Apache Notice
/*****************************************************************************
* $Header: $
* $Revision: 383115 $
* $Date: 2006-04-15 13:21:51 +0800 (星期六, 04 三月 2006) $
*
* IBatisNetDemo
* Copyright (C) 2006 - Shanyou Zhang
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
********************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using IBatisNet.DataMapper.Configuration;
using IBatisNet.DataMapper;
using IBatisNet.Common.Utilities;
using System.Reflection;
namespace IBatisNetDemo.Service
{
public class BaseService
{
private static SqlMapper sqlMap;
//private string fileName = "sqlMap.Config";
public BaseService()
{
Assembly assembly = Assembly.Load("IBatisNetDemo");
Stream stream = assembly.GetManifestResourceStream("IBatisNetDemo.sqlmap.config");
DomSqlMapBuilder builder = new DomSqlMapBuilder();
sqlMap = builder.Configure( stream );
}
public SqlMapper SqlMap
{
get
{
return sqlMap;
}
}
}
} --------------------编程问答-------------------- sqlMap = builder.Configure( stream );
在上面的地方设置断点,运行过此处后,你将鼠标指针放到sqlMap上就知道是否有值了。
补充:.NET技术 , C#