Try this with:
public class BusinessTransaction
{
   public override Equals(object other)
   {
         return RefereceEquals(this,other);
    }
}

You'll see what hpapns

On Fri, May 22, 2009 at 10:21 PM, Tim Barcz <[email protected]> wrote:

> [Test]
>         public void Equality()
>         {
>             var mock = MockRepository.GenerateMock<BusinessTransaction>();
>
>             Assert.IsTrue(mock.Equals(mock));
>
>         }
>
> On Fri, May 22, 2009 at 4:17 PM, Ayende Rahien <[email protected]> wrote:
>
>> You were using ==
>>
>>
>> On Fri, May 22, 2009 at 10:13 PM, Tim Barcz <[email protected]> wrote:
>>
>>> Why did mine pass?
>>>
>>>
>>> On Fri, May 22, 2009 at 4:09 PM, Ayende Rahien <[email protected]>wrote:
>>>
>>>> that is the expected behavior if you overrode equals
>>>>
>>>>
>>>> On Fri, May 22, 2009 at 10:05 PM, Shane Courtrille <
>>>> [email protected]> wrote:
>>>>
>>>>> NUnit but it's not the assert that fails.  I have code that does an
>>>>> Equals check and fails.  If I add a m_SourceBT.Stub(stub =>
>>>>> stub.Equals(m_SourceBT)).Return(true); everything works good.
>>>>>
>>>>>
>>>>> On Fri, May 22, 2009 at 2:49 PM, Tim Barcz <[email protected]> wrote:
>>>>>
>>>>>> Shane,
>>>>>>
>>>>>> This works for me.
>>>>>>
>>>>>> What unit test framework are you using?
>>>>>>
>>>>>> On Fri, May 22, 2009 at 9:44 AM, Shane C 
>>>>>> <[email protected]>wrote:
>>>>>>
>>>>>>>
>>>>>>> The following assertion fails...
>>>>>>>
>>>>>>> m_SourceBT = MockRepository.GenerateMock<BusinessTransaction>();
>>>>>>>
>>>>>>> Assert.IsTrue(m_SourceBT.Equals(m_SourceBT));
>>>>>>>
>>>>>>> I assume this is failing by design but I can't really understand why
>>>>>>> it would?  Does anyone know anything about this?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Shane
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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