cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandeep <Sand...@indatus.com>
Subject RE: Nunit Testing & Cassandra
Date Tue, 25 May 2010 15:19:29 GMT
A great suggestion.  I tried what you have mentioned. They are not equal.  I get the same error.

Thanks for your help. I appreciate it.

From: Miguel Verde [mailto:miguelitovert@gmail.com]
Sent: Tuesday, May 25, 2010 11:07 AM
To: user@cassandra.apache.org
Cc: user@cassandra.apache.org
Subject: Re: Nunit Testing & Cassandra

My guess is that it is using object equality to compare.  One thing to test would be to create
two KeySlices whose contents had the same values, add them to separate lists, and then compare
the lists. I think you'll find that they are not 'equivalent'.


On May 25, 2010, at 10:00 AM, Sandeep <Sandeep@indatus.com<mailto:Sandeep@indatus.com>>
wrote:
SDSWebService.Service1Test.GetListOfRowKeysFromCF:
  Expected: equivalent to < <KeySlice(key: key1,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>,
<KeySlice(key: key3,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>,
<KeySlice(key: key4,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>,
<KeySlice(key: key2,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>
>

  But was:  < <KeySlice(key: key1,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>,
<KeySlice(key: key3,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>,
<KeySlice(key: key4,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>,
<KeySlice(key: key2,columns: System.Collections.Generic.List`1[Apache.Cassandra.ColumnOrSuperColumn])>
>

Is.EquivalentTo( ICollection ) ----- tests that two collections are equivalent.

Two collections are equivalent if they contain the same items, in any order.

Assert.That(listOfKeys,  Is.EquivalentTo(TestService.GetListOfRowKeysFromCF("ColumnFamilyName","Keyspace1")));

From: Miguel Verde [mailto:miguelitovert@gmail.com]
Sent: Tuesday, May 25, 2010 9:51 AM
To: user@cassandra.apache.org<mailto:user@cassandra.apache.org>
Subject: Re: Nunit Testing & Cassandra

It would be helpful to know in what way the test fails, or more information about listOfKeys
or the return value of GetListOfRowKeysFromCF at assert time, or for that matter what GetListOfRowKeysFromCF
is, or the insertion code.

Also, does Is.EquivalentTo compare object equality on the items inside the collection? If
so, that would be a problem.
On Tue, May 25, 2010 at 8:40 AM, Sandeep <Sandeep@indatus.com<mailto:Sandeep@indatus.com>>
wrote:
            Assert.AreEqual(listOfKeys,  Is.EquivalentTo(TestService.GetListOfRowKeysFromCF("ColumnFamilyName","Keyspace1")));

            TestService.GetListOfRowKeysFromCF() returns a List<Keyslices>. I am constructing
the same list<Keyslices> in the same order in which I have inserted in some other method.

            But the test always fails. Can any one please tell me where am I going wrong.
Timestamp value is a global variable and is used through out the class.

      Thanks in advance.

Mime
View raw message