[Test]
        public void TestMe()
        {
            var document = MockRepository.GenerateMock<IDocument>();
            var table = MockRepository.GenerateMock<Table>();

            table.Expect(x => x.Cell(1, 1).Range.Text).Return("Hello
World");
            document.Expect(x => x.Content.Tables).Return(new[]
{ null, table });

            Assert.AreEqual("Hello World", document.Content.Tables
[1].Cell(1, 1).Range.Text);
        }



On Feb 11, 9:33 am, BFreakout <[email protected]> wrote:
> he...@all,
>
> my Problem is the System.NullReferenceException with Mock from my
> Interface... here the Example this doesn't work:
>
> using NUnit.Framework;
> using Rhino.Mocks;
> using TuevExportConverter.Infrastructure.Contracts;
>
> namespace TuevExportConverter.BDD
> {
>     [TestFixture]
>     public class TestMockTest
>     {
>         [Test]
>         public void TestMethod()
>         {
>             IDocument document = MockRepository.GenerateMock<IDocument>
> ();
>             document.Stub(x => x.Content.Tables[1].Cell(1,
> 1).Range.Text).Return("Hello World");
>
>             Assert.AreEqual("Hello World", document.Content.Tables
> [1].Cell(1, 1).Range.Text);
>         }
>     }
>
> }
>
> what can i do, for this Mock -> Tables[1].Cell(1, 1)
>
> regards,
>
> BFreakout
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/RhinoMocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to