public void TestSaveEntityToANewDataBase()
 {
   var uniqueWpPerson = new UniqueWPPerson {Age = 16, Name = "John", Birthday = DateTime.Now};
   UniqueWPPerson savedWPPerson = Backendless.Persistence.Save( uniqueWpPerson );
   Assert.IsNotNull( savedWPPerson, "Server returned a null result" );
   Assert.IsNotNull( savedWPPerson.Name, "Returned object doesn't have expected field" );
   Assert.IsNotNull( savedWPPerson.ObjectId, "Returned object doesn't have expected field id" );
   Assert.IsNotNull( savedWPPerson.Created, "Returned object doesn't have expected field created" );
   Assert.AreEqual( uniqueWpPerson.Name, savedWPPerson.Name, "Returned object has wrong field value" );
   Assert.AreEqual( uniqueWpPerson.Age, savedWPPerson.Age, "Returned object has wrong field value" );
   Assert.IsTrue( (savedWPPerson.Birthday.Ticks - uniqueWpPerson.Birthday.Ticks) < 1000,
                  "Returned object has wrong field value" );
 }
Example #2
0
 protected bool Equals(UniqueWPPerson other)
 {
     return(Birthday.Equals(other.Birthday));
 }
Example #3
0
 protected bool Equals( UniqueWPPerson other )
 {
   return Birthday.Equals( other.Birthday );
 }