51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

楼主: songfun
打印 上一主题 下一主题

从程序员到测试工程师(转贴)

[复制链接]

该用户从未签到

1#
发表于 2008-5-5 21:03:02 | 显示全部楼层

单元测试找bug!

namespace MyStack
{
    public class MyStack
    {
        private int nextIndex;
        private string[] elements(元素);
        public static void Main(string[] args)
        {
        }
        public MyStack()
        {
            elements = new string[100];
            nextIndex = 0;
        }
        public void Push(string element)
        {
            elements[nextIndex++] = element;
        }
        public string Pop()
        {
            return elements[--nextIndex];
        }
        public void Delete(int n)
        {
            nextIndex = nextIndex - n;
        }
        public string Top()
        {
            return elements[nextIndex-1];
        }
        public int Size()
        {
            return this.nextIndex;
        }
    }
}
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-5-14 16:31 , Processed in 0.061404 second(s), 22 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表