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 <sand...@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:miguelitov...@gmail.com]
Sent: Tuesday, May 25, 2010 9:51 AM
To: 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 <sand...@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.