public void TestSaveStringEntity() { StringEntity entity = new StringEntity {StringField = "foobar"}; StringEntity savedEntity = Backendless.Persistence.Save( entity ); Assert.IsNotNull( savedEntity, "Server returned a null result" ); Assert.IsNotNull( savedEntity.StringField, "Returned object doesn't have expected field" ); Assert.IsNotNull( savedEntity.ObjectId, "Returned object doesn't have expected field id" ); Assert.IsNotNull( savedEntity.Created, "Returned object doesn't have expected field created" ); Assert.AreEqual( entity.StringField, savedEntity.StringField, "Returned object has wrong field value" ); }
public void TestFindRecordById() { StringEntity entity = new StringEntity(); entity.StringField = "foobar"; StringEntity savedEntity = Backendless.Persistence.Save( entity ); Assert.IsNotNull( savedEntity, "Server returned a null result" ); Assert.IsNotNull( savedEntity.StringField, "Returned object doesn't have expected field" ); Assert.IsNotNull( savedEntity.ObjectId, "Returned object doesn't have expected field id" ); Assert.IsNotNull( savedEntity.Created, "Returned object doesn't have expected field created" ); Assert.AreEqual( entity.StringField, savedEntity.StringField, "Returned object has wrong field value" ); var foundEntity = Backendless.Persistence.Of<StringEntity>().FindById( savedEntity.ObjectId ); Assert.AreEqual( savedEntity.Created, foundEntity.Created, "Found object contain wrong created date" ); Assert.AreEqual( savedEntity.ObjectId, foundEntity.ObjectId, "Found object contain wrong objectId" ); Assert.AreEqual( savedEntity.StringField, foundEntity.StringField, "Found object contain wrong field value" ); }
protected bool Equals( StringEntity other ) { return base.Equals( other ) && string.Equals( StringField, other.StringField ); }
protected bool Equals(StringEntity other) { return(base.Equals(other) && string.Equals(StringField, other.StringField)); }