Created
October 24, 2010 01:09
-
-
Save leandrosilva/642935 to your computer and use it in GitHub Desktop.
Very simple flush, write, read and remove workflow from F# to Redis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This code use redis-sharp library by Miguel de Icaza. | |
| http://github.com/migueldeicaza/redis-sharp | |
| That's a very simple test of Redis 2.0.1, Mono 2.8 and F# together on Mac OS X Snow Leopard to rock! | |
| See also: http://gist.github.com/642656 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #light | |
| open NUnit.Framework | |
| [<TestFixture>] | |
| type RedisAccessTestCases = class | |
| new() = {} | |
| [<Test>] | |
| member x.ShouldReadAndWrite() = | |
| let k = "foo" | |
| let v = "bar" | |
| let reddo = new Redis() | |
| reddo.FlushAll() | |
| Assert.AreEqual(0, reddo.Keys.Length) | |
| reddo.Set(k, v) | |
| Assert.AreEqual(1, reddo.Keys.Length) | |
| Assert.AreEqual(Redis.KeyType.String, reddo.TypeOf(k)) | |
| Assert.AreEqual(v, reddo.GetString(k)) | |
| reddo.Remove(k) |> ignore | |
| Assert.AreEqual(0, reddo.Keys.Length) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment