Permalink
Browse files

fixed bug on insert entity

  • Loading branch information...
1 parent d706483 commit 45f3b5684cb9f8a2e6da03b2c6014d29b37aeb84 @richorama committed Nov 19, 2013
Showing with 12 additions and 12 deletions.
  1. +8 −8 TestRunner/Tests/TableTests.cs
  2. +4 −4 netmfazurestorage/Table/TableClient.cs
@@ -29,7 +29,7 @@ public void Run()
private void TestCreate()
{
- this.client.CreateTable("netmftest");
+ this.client.CreateTable("ranetmftest");
}
@@ -49,7 +49,7 @@ public void TestInsert()
tep.Type = "Edm.String";
values.Add(tep);
- var code = this.client.InsertTableEntity("netmftest", "1", Guid.NewGuid().ToString(), DateTime.Now, values);
+ var code = this.client.InsertTableEntity("ranetmftest", "1", Guid.NewGuid().ToString(), DateTime.UtcNow, values);
Debug.Assert(HttpStatusCode.Created == code);
}
@@ -75,7 +75,7 @@ public void TestInsertDouble()
tep.Type = "Edm.Double";
values.Add(tep);
- var code = this.client.InsertTableEntity("netmftest", "1", Guid.NewGuid().ToString(), DateTime.Now, values);
+ var code = this.client.InsertTableEntity("ranetmftest", "1", Guid.NewGuid().ToString(), DateTime.Now, values);
Debug.Assert(HttpStatusCode.Created == code);
}
@@ -90,19 +90,19 @@ public void TestInsertExperimental()
values.Add("doublefield", (double)123.22);
values.Add("int64field", (Int64)64);
values.Add("boolfield", true);
- var code = this.client.InsertTableEntity("netmftest", "2", Guid.NewGuid().ToString(), DateTime.Now, values);
+ var code = this.client.InsertTableEntity("ranetmftest", "2", Guid.NewGuid().ToString(), DateTime.Now, values);
Debug.Assert(code == System.Net.HttpStatusCode.Created);
}
public void QuerySingleEntity()
{
- var output = this.client.QueryTable("netmftest", "2", "796440bd-95f6-0626-975b-764e6902844d");
+ var output = this.client.QueryTable("ranetmftest", "2", "2b331c6e-4d7b-152b-d433-5c1a57988a75");
Debug.Assert(null != output);
}
public void QueryMultipleEntities()
{
- var output = this.client.QueryTable("netmftest", "PartitionKey eq '2'");
+ var output = this.client.QueryTable("ranetmftest", "PartitionKey eq '2'");
Debug.Assert(null != output);
Debug.Assert(output.Count > 0);
}
@@ -118,10 +118,10 @@ public void UpdateTableEntity()
values.Add("doublefield", (double)123.22);
values.Add("int64field", (Int64)64);
values.Add("boolfield", true);
- var code1 = this.client.InsertTableEntity("netmftest", "3", rowKey.ToString(), DateTime.Now, values);
+ var code1 = this.client.InsertTableEntity("ranetmftest", "3", rowKey.ToString(), DateTime.Now, values);
values["stringfield"] = "updated string";
- var code2 = this.client.UpdateTableEntity("netmftest", "3", rowKey.ToString(), DateTime.Now, values);
+ var code2 = this.client.UpdateTableEntity("ranetmftest", "3", rowKey.ToString(), DateTime.Now, values);
}
}
@@ -65,11 +65,11 @@ public HttpStatusCode InsertTableEntity(string tablename, string partitionKey, s
var timestamp = timeStamp.ToString("yyyy-MM-ddTHH:mm:ss.0000000Z");
string xml =
- StringUtility.Format("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><entry xml:base=\"http://{0}.table.core.windows.net/\" xmlns:d=\"http://schemas.microsoft.com/ado/2007/08/dataservices\" xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\" m:etag=\"W/&quot;datetime'2008-09-18T23%3A46%3A19.4277424Z'&quot;\" xmlns=\"http://www.w3.org/2005/Atom\">" +
+ StringUtility.Format("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><entry xmlns:d=\"http://schemas.microsoft.com/ado/2007/08/dataservices\" xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\" m:etag=\"W/&quot;datetime'2013-11-11T18%3A46%3A19.4277424Z'&quot;\" xmlns=\"http://www.w3.org/2005/Atom\">" +
"<id>http://{0}.table.core.windows.net/{5}(PartitionKey='{2}',RowKey='{3}')</id>" +
"<title/><updated>{1}</updated><author><name /></author>" +
"<link />" +
- "<category term=\"{0}.Tables\" scheme=\"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme\" />" +
+ //"<category term=\"{0}.Tables\" scheme=\"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme\" />" +
"<content type=\"application/xml\"><m:properties><d:PartitionKey>{2}</d:PartitionKey><d:RowKey>{3}</d:RowKey>" +
"<d:Timestamp m:type=\"Edm.DateTime\">{1}</d:Timestamp>" +
"{4}" +
@@ -106,11 +106,11 @@ private string FormatEntityXml(string tablename, string partitionKey, string row
var timestamp = timeStamp.ToString("yyyy-MM-ddTHH:mm:ss.0000000Z");
string xml =
- StringUtility.Format("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><entry xml:base=\"http://{0}.table.core.windows.net/\" xmlns:d=\"http://schemas.microsoft.com/ado/2007/08/dataservices\" xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\" m:etag=\"W/&quot;datetime'2008-09-18T23%3A46%3A19.4277424Z'&quot;\" xmlns=\"http://www.w3.org/2005/Atom\">" +
+ StringUtility.Format("<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><entry xmlns:d=\"http://schemas.microsoft.com/ado/2007/08/dataservices\" xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\" xmlns=\"http://www.w3.org/2005/Atom\">" +
"<id>http://{0}.table.core.windows.net/{5}(PartitionKey='{2}',RowKey='{3}')</id>" +
"<title/><updated>{1}</updated><author><name /></author>" +
"<link />" +
- "<category term=\"{0}.Tables\" scheme=\"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme\" />" +
+ //"<category term=\"{0}.Tables\" scheme=\"http://schemas.microsoft.com/ado/2007/08/dataservices/scheme\" />" +
"<content type=\"application/xml\"><m:properties><d:PartitionKey>{2}</d:PartitionKey><d:RowKey>{3}</d:RowKey>" +
"<d:Timestamp m:type=\"Edm.DateTime\">{1}</d:Timestamp>" +
"{4}" +

0 comments on commit 45f3b56

Please sign in to comment.