Esempio n. 1
0
        public void AddNew()
        {
            mock.Mockery mockery = new mock.Mockery();
            IProjectView mockView = this.GetMockView_AddNew(mockery);

            ProjectPresenter p = new ProjectPresenter(mockView);
            p.AddNew(null, null);

            Assert.That(this.dv.CurrentMode, Is.EqualTo(DetailsViewMode.Insert),
                "Details View should be in insert mode");
            Assert.That(this.dv.Visible, Is.EqualTo(true),"Details View should be visible");

            mockery.VerifyAllExpectationsHaveBeenMet();
        }
Esempio n. 2
0
        public void ItemInserted()
        {
            mock.Mockery mockery = new mock.Mockery();
            IProjectView mockView = (IProjectView)mockery.NewMock(typeof(IProjectView));
            mock.Expect.Exactly(2).On(mockView).GetProperty("DataPath").Will(mock.Return.Value(this._DataPath));
            mock.Expect.Once.On(mockView).GetProperty("Details").Will(mock.Return.Value(this.dv));

            ProjectPresenter presenter = new ProjectPresenter(mockView);
            presenter.ItemInserted(null, null);

            Assert.That(this.dv.Visible, Is.False, "Details view should be invisible");

            mockery.VerifyAllExpectationsHaveBeenMet();
        }
Esempio n. 3
0
        public void ItemCommand_Edit()
        {
            mock.Mockery mockery = new mock.Mockery();
            IProjectView mockView = (IProjectView)mockery.NewMock(typeof(IProjectView));

            DetailsViewCommandEventArgs e = this.GetDetailsViewCommandEventArgs(UpdateType.Update);
            // DetailsView dv = this.GetProjectDetails(UpdateType.Update);
            mock.Expect.Exactly(2).On(mockView).GetProperty("DataPath").Will(mock.Return.Value(this._DataPath));
            mock.Expect.Once.On(mockView).Method("DetailsFocus");

            ProjectPresenter presenter = new ProjectPresenter(mockView);
            presenter.ItemCommand(null, e);

            mockery.VerifyAllExpectationsHaveBeenMet();
        }
        public void PageLoad()
        {
            this._ProjectId = 1;
            _.Mockery mockery = new _.Mockery();
            ITimeSheetView mockView = this.GetMockView(mockery);
            // IHour mockHour = this.GetMockHour(mockery);
            IHour mockHour = null;
            IProject mockProject = this.GetMockProject(mockery);

            TimeSheetPresenter p = new TimeSheetPresenter(mockView, mockHour, mockProject);
            p.PageLoad(null, null);

            this.PageLoadAssertions();

            mockery.VerifyAllExpectationsHaveBeenMet();
        }
        public void PageLoad()
        {
            mock.Mockery mockery = new mock.Mockery();
            IHourSummaryView mockView = this.GetMockView(mockery);
            IHour mockHour = this.GetMockHour(mockery);
            IProject mockProject = this.GetMockProject(mockery);

            HourSummaryPresenter p = new HourSummaryPresenter(mockView, mockHour, mockProject);
            p.PageLoad(null, null);

            Assert.That(this._gvHoursPerMonthList.Rows.Count, Is.GreaterThan(0), "No data in Hours Per Month List");
            Assert.That(this._gvHoursPerMonthList.Rows.Count, Is.EqualTo(1), "Hours Per Month List: wrong row count");
            Assert.That(this._gvHoursPerMonthPerProjectList.Rows.Count, Is.GreaterThan(0), "No data in Hours Per Month Per Project List");
            Assert.That(this._gvHoursPerMonthPerProjectList.Rows.Count, Is.EqualTo(1), "Hours Per Month Per Project List: wrong row count");
            Assert.That(this._gvHoursPerWeekPerProjectList.Rows.Count, Is.GreaterThan(0), "No data in Hours Per Week Per Project List");
            Assert.That(this._gvHoursPerWeekPerProjectList.Rows.Count, Is.EqualTo(1), "Hours Per Month Per Week List: wrong row count");

            mockery.VerifyAllExpectationsHaveBeenMet();
        }
Esempio n. 6
0
        public void PageLoad()
        {
            mock.Mockery mockery = new mock.Mockery();
            IProjectView mockView = this.GetMockView(mockery);

            ProjectPresenter p = new ProjectPresenter(mockView);
            p.PageLoad(null, null);
            Assert.That(this.dv.Visible, Is.False, "Details should be invisible");

            mockery.VerifyAllExpectationsHaveBeenMet();
        }
Esempio n. 7
0
        public void StoryListSelectedIndexChanged()
        {
            mock.Mockery mockery = new mock.Mockery();
            IProjectView mockView = this.GetMockView_GetStoryList(mockery);

            ProjectPresenter presenter = new ProjectPresenter(mockView);
            presenter.StoryListSelectedIndexChanged(null, null);

            mockery.VerifyAllExpectationsHaveBeenMet();
        }
        private void AddNew()
        {
            _.Mockery mockery = new _.Mockery();
            ITimeSheetView mockView = this.GetMockView_AddNew(mockery);
            IHour mockHour = this.GetMockHours_AddNew(mockery);
            IProject mockProject = this.GetMockProject_AddNew(mockery);

            TimeSheetPresenter p = new TimeSheetPresenter(mockView, mockHour, mockProject);
            p.Edit(null, null);

            Assert.That(this._txtProject.Text, Is.Empty,
                "Need to clear out the Project Text Box so the same name doesn't get added twice");
            mockery.VerifyAllExpectationsHaveBeenMet();
        }
Esempio n. 9
0
    public void SetUp()
    {
        string xml = "<task ikey=\"convert_premium_to_ingame\" >\n" +
                     "  <label>Convert Premium</label>\n" +
                     "  <description>A funky description</decsription>\n" +
                     "  <location/>\n" +
                     "  <tags/>\n" +
                     "  <costs>\n" +
                     "    <stat_cost type=\"currency\" ikey=\"premium_web\" value=\"10\" ok=\"false\" reason=\"Insufficient Premium (Web)\" />\n" +
                     "  </costs>\n" +
                     "  <rewards>\n" +
                     "    <grant_stat_range type=\"currency\" ikey=\"gamecoins\" min=\"100\" max=\"100\" />\n" +
                     "  </rewards>\n" +
                     "  <mastery level=\"\" progress=\"\"/>\n" +
                     "</task>";

        XMLNode nn = (new XMLNode.XMLParser()).Parse(xml);

        n = nn.GetFirstChild("task") as XMLNode;

        ee = new DC.XmlToTaskHashtable();
        mocks = new NMock2.Mockery();
    }