Exemplo n.º 1
0
        public void SetUp()
        {
            _TaskTreeView    = new NuGenTaskTreeView();
            _InitialCount    = _TaskTreeView.Nodes.Count;
            _EventSink       = new TaskTreeViewEventSink(_TaskTreeView);
            _ServiceProvider = new NuGenTaskServiceProvider();
            _XmlDoc          = new XmlDocument();

            _TaskItemDescription = "Description";
            _TaskItemMock        = new DynamicMock(typeof(TaskItem));
            _TaskItemMock.SetValue("Description", _TaskItemDescription);
            _TaskItem = (TaskItem)_TaskItemMock.Object;

            Assert.IsFalse(_TaskTreeView.LabelEdit);
        }
Exemplo n.º 2
0
    public void AgeCalculation()
    {
        IMock mock =
            new DynamicMock(typeof(ICustomer));
        ICustomer customer = (ICustomer)mock.Object;

        mock.SetValue("Title", "Mr.");
        mock.SetValue("FirstName", "Fred");
        mock.SetValue("MiddleInitial", "E");
        mock.SetValue("LastName", "Bloggs");
        mock.SetValue("NameSuffix", "III");

        Mailer mailer = new Mailer(customer);

        Assert.That(
            "Mr. Bloggs",
            Is.EqualTo(mailer.ShortGreeting())
            );

        Assert.That(
            "Mr. Fred E Bloggs, III",
            Is.EqualTo(mailer.FullGreeting())
            );
    }