Ehsan Akbar

Results 16 comments of Ehsan Akbar

Based on the shown code, the subject under test uses `AcceptConditionalRiskAgreementCommand` //... var addRes = await _mediator.Send(new AcceptConditionalRiskAgreementCommand(), cancellationToken); //... but in the test the mocked mediator is setup to...

I need just one session for my tests as you can see in each test I have insert some fake data in database and after inserting I have to call...

How can I delete the data after my PostClientAppSettingControllerTest: ``` IDocumentSession session = mystatic._store; session.Delete(data.Setting); session.SaveChanges(); ``` But it returns error

> `IDocumentSession Store` < that is _super_ misleading. This is a session, not a store. > > _Why_ are you trying to do it in a single session? That is...

Thank you . In fact I couldn't change any code in this service `var response = await client.DeleteAsync($"api/draft/"+data.Id);` but I could change the code inside my unit tests , Is...

I added this to my test session.Advanced.Clear(); But didn't work

I added no tracking option to my test code : ``` IAsyncDocumentSession session = fixture.documentStore.OpenAsyncSession(new SessionOptions { NoTracking = true }); await session.StoreAsync(data); await session.SaveChangesAsync(); ``` And now I get...

> What is it that you are trying to do? It looks like you are trying to use this for a website? Is that for tests? Yes It is for...

> var storeHolder = new DocumentStoreHolder(); _store = storeHolder.Store; Thank you haludi.It works .thank you .

As you know the session is static , so as a another question would you please let me know that can I remove and add data to this session ?