query from InMemory database in .net core unit testing
up vote
0
down vote
favorite
i am using UseInMemoryDatabase() function in below code statement:
var options = new DbContextOptionsBuilder<CRUDContext>()
.UseInMemoryDatabase(databaseName: "DBTest1")
.Options;
// Run the test against one instance of the context
using (var context = new CRUDContext(options))
now i want to query on "DBTest1" from SQL Server Object Explorer in VS or query on "DBTest1" from Microsoft SQL Server Management Studio.
how can i do that?
thanks guys.
unit-testing asp.net-core .net-core in-memory-database
|
show 1 more comment
up vote
0
down vote
favorite
i am using UseInMemoryDatabase() function in below code statement:
var options = new DbContextOptionsBuilder<CRUDContext>()
.UseInMemoryDatabase(databaseName: "DBTest1")
.Options;
// Run the test against one instance of the context
using (var context = new CRUDContext(options))
now i want to query on "DBTest1" from SQL Server Object Explorer in VS or query on "DBTest1" from Microsoft SQL Server Management Studio.
how can i do that?
thanks guys.
unit-testing asp.net-core .net-core in-memory-database
Sounds like you’ve misunderstood what this is for, you won’t use it in SSMS, see this link
– Matt
Nov 10 at 11:06
thank you dear Matt. I used that in unit testing. i want just access to DBTest and querying on it in debugging mode when created OTA. what you mean? can you explain more?
– Hamid Nasirloo
Nov 10 at 11:42
If you want to look at data whilst debugging tests you can use your context pretty much as you would when debugging your actual application code. But what I meant was that this in memory database is really just for testing so the best way to use it is to just assert what you expect to see in it add the end of each test. By the way I just realised I put the wrong link in my first comment! Here’s the correct link
– Matt
Nov 10 at 12:35
thank you dear matt. i saw that link before. however our need is to query from OTA created database in SQL Server Object Explorer or in Microsoft SQL Server Management Studio.
– Hamid Nasirloo
Nov 10 at 13:04
No problem, this is only meant to be used for testing so I don’t think it’s possible to access it via SSMS.
– Matt
Nov 10 at 14:46
|
show 1 more comment
up vote
0
down vote
favorite
up vote
0
down vote
favorite
i am using UseInMemoryDatabase() function in below code statement:
var options = new DbContextOptionsBuilder<CRUDContext>()
.UseInMemoryDatabase(databaseName: "DBTest1")
.Options;
// Run the test against one instance of the context
using (var context = new CRUDContext(options))
now i want to query on "DBTest1" from SQL Server Object Explorer in VS or query on "DBTest1" from Microsoft SQL Server Management Studio.
how can i do that?
thanks guys.
unit-testing asp.net-core .net-core in-memory-database
i am using UseInMemoryDatabase() function in below code statement:
var options = new DbContextOptionsBuilder<CRUDContext>()
.UseInMemoryDatabase(databaseName: "DBTest1")
.Options;
// Run the test against one instance of the context
using (var context = new CRUDContext(options))
now i want to query on "DBTest1" from SQL Server Object Explorer in VS or query on "DBTest1" from Microsoft SQL Server Management Studio.
how can i do that?
thanks guys.
unit-testing asp.net-core .net-core in-memory-database
unit-testing asp.net-core .net-core in-memory-database
asked Nov 10 at 10:22
Hamid Nasirloo
313
313
Sounds like you’ve misunderstood what this is for, you won’t use it in SSMS, see this link
– Matt
Nov 10 at 11:06
thank you dear Matt. I used that in unit testing. i want just access to DBTest and querying on it in debugging mode when created OTA. what you mean? can you explain more?
– Hamid Nasirloo
Nov 10 at 11:42
If you want to look at data whilst debugging tests you can use your context pretty much as you would when debugging your actual application code. But what I meant was that this in memory database is really just for testing so the best way to use it is to just assert what you expect to see in it add the end of each test. By the way I just realised I put the wrong link in my first comment! Here’s the correct link
– Matt
Nov 10 at 12:35
thank you dear matt. i saw that link before. however our need is to query from OTA created database in SQL Server Object Explorer or in Microsoft SQL Server Management Studio.
– Hamid Nasirloo
Nov 10 at 13:04
No problem, this is only meant to be used for testing so I don’t think it’s possible to access it via SSMS.
– Matt
Nov 10 at 14:46
|
show 1 more comment
Sounds like you’ve misunderstood what this is for, you won’t use it in SSMS, see this link
– Matt
Nov 10 at 11:06
thank you dear Matt. I used that in unit testing. i want just access to DBTest and querying on it in debugging mode when created OTA. what you mean? can you explain more?
– Hamid Nasirloo
Nov 10 at 11:42
If you want to look at data whilst debugging tests you can use your context pretty much as you would when debugging your actual application code. But what I meant was that this in memory database is really just for testing so the best way to use it is to just assert what you expect to see in it add the end of each test. By the way I just realised I put the wrong link in my first comment! Here’s the correct link
– Matt
Nov 10 at 12:35
thank you dear matt. i saw that link before. however our need is to query from OTA created database in SQL Server Object Explorer or in Microsoft SQL Server Management Studio.
– Hamid Nasirloo
Nov 10 at 13:04
No problem, this is only meant to be used for testing so I don’t think it’s possible to access it via SSMS.
– Matt
Nov 10 at 14:46
Sounds like you’ve misunderstood what this is for, you won’t use it in SSMS, see this link
– Matt
Nov 10 at 11:06
Sounds like you’ve misunderstood what this is for, you won’t use it in SSMS, see this link
– Matt
Nov 10 at 11:06
thank you dear Matt. I used that in unit testing. i want just access to DBTest and querying on it in debugging mode when created OTA. what you mean? can you explain more?
– Hamid Nasirloo
Nov 10 at 11:42
thank you dear Matt. I used that in unit testing. i want just access to DBTest and querying on it in debugging mode when created OTA. what you mean? can you explain more?
– Hamid Nasirloo
Nov 10 at 11:42
If you want to look at data whilst debugging tests you can use your context pretty much as you would when debugging your actual application code. But what I meant was that this in memory database is really just for testing so the best way to use it is to just assert what you expect to see in it add the end of each test. By the way I just realised I put the wrong link in my first comment! Here’s the correct link
– Matt
Nov 10 at 12:35
If you want to look at data whilst debugging tests you can use your context pretty much as you would when debugging your actual application code. But what I meant was that this in memory database is really just for testing so the best way to use it is to just assert what you expect to see in it add the end of each test. By the way I just realised I put the wrong link in my first comment! Here’s the correct link
– Matt
Nov 10 at 12:35
thank you dear matt. i saw that link before. however our need is to query from OTA created database in SQL Server Object Explorer or in Microsoft SQL Server Management Studio.
– Hamid Nasirloo
Nov 10 at 13:04
thank you dear matt. i saw that link before. however our need is to query from OTA created database in SQL Server Object Explorer or in Microsoft SQL Server Management Studio.
– Hamid Nasirloo
Nov 10 at 13:04
No problem, this is only meant to be used for testing so I don’t think it’s possible to access it via SSMS.
– Matt
Nov 10 at 14:46
No problem, this is only meant to be used for testing so I don’t think it’s possible to access it via SSMS.
– Matt
Nov 10 at 14:46
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237991%2fquery-from-inmemory-database-in-net-core-unit-testing%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sounds like you’ve misunderstood what this is for, you won’t use it in SSMS, see this link
– Matt
Nov 10 at 11:06
thank you dear Matt. I used that in unit testing. i want just access to DBTest and querying on it in debugging mode when created OTA. what you mean? can you explain more?
– Hamid Nasirloo
Nov 10 at 11:42
If you want to look at data whilst debugging tests you can use your context pretty much as you would when debugging your actual application code. But what I meant was that this in memory database is really just for testing so the best way to use it is to just assert what you expect to see in it add the end of each test. By the way I just realised I put the wrong link in my first comment! Here’s the correct link
– Matt
Nov 10 at 12:35
thank you dear matt. i saw that link before. however our need is to query from OTA created database in SQL Server Object Explorer or in Microsoft SQL Server Management Studio.
– Hamid Nasirloo
Nov 10 at 13:04
No problem, this is only meant to be used for testing so I don’t think it’s possible to access it via SSMS.
– Matt
Nov 10 at 14:46