#region License
/**
* Ingenious MVC : An MVC framework for .NET 2.0
* Copyright (C) 2006, JDP Group
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Authors: - Kent Boogaart (kentcb@internode.on.net)
*/
#endregion
using System;
using System.Windows.Forms;
using NUnit.Framework;
using Ingenious.Mvc.Configuration;
using Ingenious.Mvc.Views;
using Ingenious.Mvc.Windows.Forms.Views;
using Ingenious.Mvc.UnitTest.MockTypes;
namespace Ingenious.Mvc.UnitTest.Windows.Forms.Views{
/// <summary>
/// Unit tests the <see cref="WizardUserControlBase"/> class.
/// </summary>
public sealed class WizardUserControlBaseTest : UnitTestBase
{
private WizardUserControlBase _wizardUserControl;
private bool _changed;
protected override void SetUp()
{
_changed = false;
_wizardUserControl = new WizardUserControlBase();
_wizardUserControl.Changed += new EventHandler<EventArgs>(_wizardUserControl_Changed);
}
protected override void TearDown()
{
_wizardUserControl.Changed -= new EventHandler<EventArgs>(_wizardUserControl_Changed);
}
[Test]
public void TestCanDoPreviousChanged()
{
Assert.IsTrue(_wizardUserControl.CanDoPrevious);
Assert.IsFalse(_changed);
_wizardUserControl.CanDoPrevious = false;
Assert.IsTrue(_changed);
}
[Test]
public void TestCanDoNextChanged()
{
Assert.IsTrue(_wizardUserControl.CanDoNext);
Assert.IsFalse(_changed);
_wizardUserControl.CanDoNext = false;
Assert.IsTrue(_changed);
}
[Test]
public void TestCanCancelChanged()
{
Assert.IsTrue(_wizardUserControl.CanCancel);
Assert.IsFalse(_changed);
_wizardUserControl.CanCancel = false;
Assert.IsTrue(_changed);
}
private void _wizardUserControl_Changed(object sender, EventArgs e)
{
_changed = true;
}
}
}
|