Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
74f62580
Commit
74f62580
authored
Mar 24, 2014
by
Marc Gravell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5 from matteobaglini/master
Fix: Null RedisValue from boolean value
parents
732cea8c
eb2608cc
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
1 deletion
+36
-1
Bits.cs
StackExchange.Redis.Tests/Bits.cs
+24
-0
KeysAndValues.cs
StackExchange.Redis.Tests/KeysAndValues.cs
+10
-0
StackExchange.Redis.Tests.csproj
StackExchange.Redis.Tests/StackExchange.Redis.Tests.csproj
+1
-0
RedisValue.cs
StackExchange.Redis/StackExchange/Redis/RedisValue.cs
+1
-1
No files found.
StackExchange.Redis.Tests/Bits.cs
0 → 100644
View file @
74f62580
using
System.Linq
;
using
NUnit.Framework
;
namespace
StackExchange.Redis.Tests
{
[
TestFixture
]
public
class
Bits
:
TestBase
{
[
Test
]
public
void
BasicOps
()
{
using
(
var
conn
=
Create
())
{
var
db
=
conn
.
GetDatabase
();
RedisKey
key
=
Me
();
db
.
KeyDelete
(
key
,
CommandFlags
.
FireAndForget
);
db
.
StringSetBit
(
key
,
10
,
true
);
Assert
.
True
(
db
.
StringGetBit
(
key
,
10
));
Assert
.
False
(
db
.
StringGetBit
(
key
,
11
));
}
}
}
}
\ No newline at end of file
StackExchange.Redis.Tests/KeysAndValues.cs
View file @
74f62580
...
...
@@ -42,6 +42,13 @@ public void TestValues()
RedisValue
i8
=
1L
;
CheckNotNull
(
i8
);
RedisValue
bool1
=
true
;
CheckNotNull
(
bool1
);
RedisValue
bool2
=
false
;
CheckNotNull
(
bool2
);
RedisValue
bool3
=
true
;
CheckNotNull
(
bool3
);
CheckSame
(
a0
,
a0
);
CheckSame
(
a1
,
a1
);
CheckSame
(
a0
,
a1
);
...
...
@@ -53,6 +60,9 @@ public void TestValues()
CheckSame
(
i4
,
i4
);
CheckSame
(
i8
,
i8
);
CheckSame
(
i4
,
i8
);
CheckSame
(
bool1
,
bool3
);
CheckNotSame
(
bool1
,
bool2
);
}
private
void
CheckSame
(
RedisValue
x
,
RedisValue
y
)
...
...
StackExchange.Redis.Tests/StackExchange.Redis.Tests.csproj
View file @
74f62580
...
...
@@ -62,6 +62,7 @@
<ItemGroup>
<Compile
Include=
"AsyncTests.cs"
/>
<Compile
Include=
"BasicOps.cs"
/>
<Compile
Include=
"Bits.cs"
/>
<Compile
Include=
"Cluster.cs"
/>
<Compile
Include=
"Commands.cs"
/>
<Compile
Include=
"ConnectionShutdown.cs"
/>
...
...
StackExchange.Redis/StackExchange/Redis/RedisValue.cs
View file @
74f62580
...
...
@@ -274,7 +274,7 @@ internal RedisValue Assert()
/// </summary>
public
static
implicit
operator
RedisValue
(
bool
value
)
{
return
value
?
new
RedisValue
(
1
,
null
)
:
new
RedisValue
(
0
,
nul
l
);
return
value
?
new
RedisValue
(
1
,
IntegerSentinel
)
:
new
RedisValue
(
0
,
IntegerSentine
l
);
}
/// <summary>
/// Creates a new RedisValue from a Boolean
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment