public void LongGrainIdToStringAreSame() { const long LongGrainId = 1001; var longGrainIdAsString = new AdoGrainKey(LongGrainId, null).ToString(); Assert.Equal(longGrainIdAsString, LongGrainId.ToString(CultureInfo.InvariantCulture)); }
public void LongGrainIdWithExtensionAreSame() { const long LongGrainId = 1001; const string ExtensionKey = "ExtensionKey"; var longGrainIdWitExtensionAsString = new AdoGrainKey(LongGrainId, ExtensionKey).ToString(); //AdoGrainKey helper class splits the grain key and extension key using character '#'. //The key and its extension are the two distinct elements. var grainKeys = longGrainIdWitExtensionAsString.Split(new[] { "#" }, StringSplitOptions.RemoveEmptyEntries); Assert.Equal(2, grainKeys.Length); Assert.Equal(grainKeys[0], LongGrainId.ToString(CultureInfo.InvariantCulture)); Assert.Equal(grainKeys[1], ExtensionKey); }