SetResult() 공개 메소드

public SetResult ( string resultName ) : void
resultName string
리턴 void
예제 #1
0
        public void SetResultSelectsCorrectResult()
        {
            MockRepository mocks = new MockRepository();
            TestPage page = new TestPage();

            Result theResult = (Result) mocks.CreateMock(typeof (Result));
            theResult.Navigate(page);
            mocks.ReplayAll();

            page.Results.Add( "theResult", theResult );
            page.SetResult("theResult");
            mocks.VerifyAll();
        }
예제 #2
0
        public void SetResultThrowsVerboseExceptionOnUnknownResultName()
        {
            string RESULTNAME = "nonexistant result";

            TestPage page = new TestPage();
            try
            {
                page.SetResult(RESULTNAME);
                Assert.Fail();
            }
            catch(ArgumentException ae)
            {
                string expected = string.Format("No mapping found for the specified destination '{0}'.", RESULTNAME);
                string msg = ae.Message.Substring(0, expected.Length);
                Assert.AreEqual(expected, msg);
            }
        }