示例#1
0
        public int addColorTest([PexAssumeUnderTest] BusinessPlayer target, string data)
        {
            int result = target.addColor(data);

            return(result);
            // TODO: add assertions to method BusinessPlayerTest.addColorTest(BusinessPlayer, String)
        }
示例#2
0
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            String         input    = colorsBox.Text;
            BusinessPlayer business = new BusinessPlayer(Login.UserName, Login.Password);

            if (input.Equals(""))
            {
                MessageBox.Show("Vui lòng nhập màu sắc!");
                return;
            }

            if (business.getColor(input) > 0)
            {
                MessageBox.Show("Màu đã tồn tại. Vui lòng nhập màu khác!");
                return;
            }

            if (business.addColor(input) > 0)
            {
                MessageBox.Show("Thêm thành công!");
                this.DialogResult = DialogResult.OK;
                this.color        = input;
                this.Close();
            }
            else
            {
                MessageBox.Show("Thêm thất bại!");
            }
        }