Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
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
CAP
Commits
03ca87c0
Commit
03ca87c0
authored
Jun 29, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Tests.
parent
1a35a8b0
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
42 additions
and
34 deletions
+42
-34
CapStartContext.cs
src/DotNetCore.CAP/CapStartContext.cs
+0
-22
MessageStoreTest.cs
...tNetCore.CAP.EntityFrameworkCore.Test/MessageStoreTest.cs
+2
-2
20170629074320_InitCreate.Designer.cs
...ore.Test/Migrations/20170629074320_InitCreate.Designer.cs
+4
-4
20170629074320_InitCreate.cs
...rameworkCore.Test/Migrations/20170629074320_InitCreate.cs
+3
-3
TestDbContextModelSnapshot.cs
...ameworkCore.Test/Migrations/TestDbContextModelSnapshot.cs
+2
-2
CAP.BuilderTest.cs
test/DotNetCore.CAP.Test/CAP.BuilderTest.cs
+15
-0
NoopMessageStore.cs
test/DotNetCore.CAP.Test/NoopMessageStore.cs
+15
-0
MessageManagerTestBase.cs
test/Shared/MessageManagerTestBase.cs
+1
-1
No files found.
src/DotNetCore.CAP/CapStartContext.cs
deleted
100644 → 0
View file @
1a35a8b0
using
System
;
using
System.Threading
;
namespace
DotNetCore.CAP
{
public
class
CapStartContext
{
public
CapStartContext
()
{
}
public
CapStartContext
(
IServiceProvider
provider
,
CancellationToken
cancellationToken
)
{
ServiceProvider
=
provider
;
CancellationToken
=
cancellationToken
;
}
public
IServiceProvider
ServiceProvider
{
get
;
set
;
}
public
CancellationToken
CancellationToken
{
get
;
}
}
}
\ No newline at end of file
test/DotNetCore.CAP.EntityFrameworkCore.Test/MessageStoreTest.cs
View file @
03ca87c0
...
...
@@ -18,14 +18,14 @@ namespace DotNetCore.CAP.EntityFrameworkCore.Test
{
Id
=
guid
,
Content
=
"this is message body"
,
Stat
eName
=
State
Name
.
Enqueued
Stat
usName
=
Status
Name
.
Enqueued
};
db
.
Attach
(
message
).
State
=
Microsoft
.
EntityFrameworkCore
.
EntityState
.
Added
;
db
.
SaveChanges
();
Assert
.
True
(
db
.
CapSentMessages
.
Any
(
u
=>
u
.
Id
==
guid
));
Assert
.
NotNull
(
db
.
CapSentMessages
.
FirstOrDefault
(
u
=>
u
.
Stat
eName
==
State
Name
.
Enqueued
));
Assert
.
NotNull
(
db
.
CapSentMessages
.
FirstOrDefault
(
u
=>
u
.
Stat
usName
==
Status
Name
.
Enqueued
));
}
}
...
...
test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/2017062
8102530_Init
.Designer.cs
→
test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/2017062
9074320_InitCreate
.Designer.cs
View file @
03ca87c0
...
...
@@ -8,8 +8,8 @@ using DotNetCore.CAP.EntityFrameworkCore.Test;
namespace
DotNetCore.CAP.EntityFrameworkCore.Test.Migrations
{
[
DbContext
(
typeof
(
TestDbContext
))]
[
Migration
(
"2017062
8102530_Init
"
)]
partial
class
Init
[
Migration
(
"2017062
9074320_InitCreate
"
)]
partial
class
Init
Create
{
protected
override
void
BuildTargetModel
(
ModelBuilder
modelBuilder
)
{
...
...
@@ -32,7 +32,7 @@ namespace DotNetCore.CAP.EntityFrameworkCore.Test.Migrations
b
.
Property
<
int
>(
"Retries"
);
b
.
Property
<
string
>(
"Stat
e
Name"
)
b
.
Property
<
string
>(
"Stat
us
Name"
)
.
HasMaxLength
(
50
);
b
.
HasKey
(
"Id"
);
...
...
@@ -55,7 +55,7 @@ namespace DotNetCore.CAP.EntityFrameworkCore.Test.Migrations
b
.
Property
<
int
>(
"Retries"
);
b
.
Property
<
string
>(
"Stat
e
Name"
)
b
.
Property
<
string
>(
"Stat
us
Name"
)
.
HasMaxLength
(
50
);
b
.
HasKey
(
"Id"
);
...
...
test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/2017062
8102530_Init
.cs
→
test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/2017062
9074320_InitCreate
.cs
View file @
03ca87c0
...
...
@@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace
DotNetCore.CAP.EntityFrameworkCore.Test.Migrations
{
public
partial
class
Init
:
Migration
public
partial
class
Init
Create
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
...
...
@@ -18,7 +18,7 @@ namespace DotNetCore.CAP.EntityFrameworkCore.Test.Migrations
KeyName
=
table
.
Column
<
string
>(
nullable
:
true
),
LastRun
=
table
.
Column
<
DateTime
>(
nullable
:
false
),
Retries
=
table
.
Column
<
int
>(
nullable
:
false
),
Stat
e
Name
=
table
.
Column
<
string
>(
maxLength
:
50
,
nullable
:
true
)
Stat
us
Name
=
table
.
Column
<
string
>(
maxLength
:
50
,
nullable
:
true
)
},
constraints
:
table
=>
{
...
...
@@ -35,7 +35,7 @@ namespace DotNetCore.CAP.EntityFrameworkCore.Test.Migrations
KeyName
=
table
.
Column
<
string
>(
nullable
:
true
),
LastRun
=
table
.
Column
<
DateTime
>(
nullable
:
false
),
Retries
=
table
.
Column
<
int
>(
nullable
:
false
),
Stat
e
Name
=
table
.
Column
<
string
>(
maxLength
:
50
,
nullable
:
true
)
Stat
us
Name
=
table
.
Column
<
string
>(
maxLength
:
50
,
nullable
:
true
)
},
constraints
:
table
=>
{
...
...
test/DotNetCore.CAP.EntityFrameworkCore.Test/Migrations/TestDbContextModelSnapshot.cs
View file @
03ca87c0
...
...
@@ -31,7 +31,7 @@ namespace DotNetCore.CAP.EntityFrameworkCore.Test.Migrations
b
.
Property
<
int
>(
"Retries"
);
b
.
Property
<
string
>(
"Stat
e
Name"
)
b
.
Property
<
string
>(
"Stat
us
Name"
)
.
HasMaxLength
(
50
);
b
.
HasKey
(
"Id"
);
...
...
@@ -54,7 +54,7 @@ namespace DotNetCore.CAP.EntityFrameworkCore.Test.Migrations
b
.
Property
<
int
>(
"Retries"
);
b
.
Property
<
string
>(
"Stat
e
Name"
)
b
.
Property
<
string
>(
"Stat
us
Name"
)
.
HasMaxLength
(
50
);
b
.
HasKey
(
"Id"
);
...
...
test/DotNetCore.CAP.Test/CAP.BuilderTest.cs
View file @
03ca87c0
...
...
@@ -71,6 +71,21 @@ namespace DotNetCore.CAP.Test
private
class
MyMessageStore
:
ICapMessageStore
{
public
Task
<
OperateResult
>
ChangeReceivedMessageStateAsync
(
CapReceivedMessage
message
,
string
statusName
,
bool
autoSaveChanges
=
true
)
{
throw
new
NotImplementedException
();
}
public
Task
<
OperateResult
>
ChangeSentMessageStateAsync
(
CapSentMessage
message
,
string
statusName
,
bool
autoSaveChanges
=
true
)
{
throw
new
NotImplementedException
();
}
public
Task
<
CapReceivedMessage
>
GetNextReceivedMessageToBeExcuted
()
{
throw
new
NotImplementedException
();
}
public
Task
<
CapSentMessage
>
GetNextSentMessageToBeEnqueuedAsync
()
{
throw
new
NotImplementedException
();
...
...
test/DotNetCore.CAP.Test/NoopMessageStore.cs
View file @
03ca87c0
...
...
@@ -7,6 +7,21 @@ namespace DotNetCore.CAP.Test
{
public
class
NoopMessageStore
:
ICapMessageStore
{
public
Task
<
OperateResult
>
ChangeReceivedMessageStateAsync
(
CapReceivedMessage
message
,
string
statusName
,
bool
autoSaveChanges
=
true
)
{
throw
new
NotImplementedException
();
}
public
Task
<
OperateResult
>
ChangeSentMessageStateAsync
(
CapSentMessage
message
,
string
statusName
,
bool
autoSaveChanges
=
true
)
{
throw
new
NotImplementedException
();
}
public
Task
<
CapReceivedMessage
>
GetNextReceivedMessageToBeExcuted
()
{
throw
new
NotImplementedException
();
}
public
Task
<
CapSentMessage
>
GetNextSentMessageToBeEnqueuedAsync
()
{
throw
new
NotImplementedException
();
...
...
test/Shared/MessageManagerTestBase.cs
View file @
03ca87c0
...
...
@@ -84,7 +84,7 @@ namespace DotNetCore.CAP.Test
Assert
.
NotNull
(
operateResult
);
Assert
.
True
(
operateResult
.
Succeeded
);
message
.
Stat
eName
=
State
Name
.
Processing
;
message
.
Stat
usName
=
Status
Name
.
Processing
;
operateResult
=
await
manager
.
UpdateReceivedMessageAsync
(
message
);
Assert
.
NotNull
(
operateResult
);
Assert
.
True
(
operateResult
.
Succeeded
);
...
...
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