Skip to content

Commit 0d6f34d

Browse files
committed
Update DevExtreme Mvc blog post
1 parent b21f214 commit 0d6f34d

8 files changed

+1183
-1287
lines changed

blog-posts/en/using-asp.net-zero-with-devextreme-angular-part-2.md

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ configuration.CreateMap<Person, PersonListDto>();
4949
//configuration.CreateMap<Phone, PhoneInPersonListDto>();
5050
```
5151

52-
After defining interface, we can implement it as shown below: (in **.Application** project)
52+
After defining interface, we can implement it as shown below: (in `.Application` project)
5353

5454
```csharp
5555
public class PersonAppService : PhoneBookDemoAppServiceBase, IPersonAppService
@@ -98,34 +98,24 @@ By writing unit test, we can test `GetPeople` method of `PersonAppService` witho
9898

9999
Since we disabled multitenancy, we should disable it for unit tests too. Open `PhoneBookDemoConsts` class in the `Acme.PhoneBook.Core` project and set `MultiTenancyEnabled` to false. After a rebuild and run unit tests, you will see that some tests are skipped (those are related to multitenancy).
100100

101-
Let's create first test to verify getting people without any filter:
102-
103101
```csharp
104-
using Acme.PhoneBookDemo.People;
105-
using Acme.PhoneBookDemo.People.Dtos;
106-
using Shouldly;
107-
using Xunit;
108-
109-
namespace Acme.PhoneBookDemo.Tests.People
102+
public class PersonAppService_Tests : AppTestBase
110103
{
111-
public class PersonAppService_Tests : AppTestBase
112-
{
113-
private readonly IPersonAppService _personAppService;
104+
private readonly IPersonAppService _personAppService;
114105

115-
public PersonAppService_Tests()
116-
{
117-
_personAppService = Resolve<IPersonAppService>();
118-
}
106+
public PersonAppService_Tests()
107+
{
108+
_personAppService = Resolve<IPersonAppService>();
109+
}
119110

120-
[Fact]
121-
public void Should_Get_All_People_Without_Any_Filter()
122-
{
123-
//Act
124-
var persons = _personAppService.GetPeople(new GetPeopleInput());
111+
[Fact]
112+
public void Should_Get_All_People_Without_Any_Filter()
113+
{
114+
//Act
115+
var persons = _personAppService.GetPeople(new GetPeopleInput());
125116

126-
//Assert
127-
persons.Items.Count.ShouldBe(2);
128-
}
117+
//Assert
118+
persons.Items.Count.ShouldBe(2);
129119
}
130120
}
131121
```

blog-posts/en/using-asp.net-zero-with-devextreme-angular-part-3.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,7 @@ public async Task Should_Create_Person_With_Valid_Arguments()
8484
}
8585
```
8686

87-
Test method also written using **async/await** pattern since calling
88-
method is async. We called `CreatePerson` method, then checked if given
89-
person is in the database. `UsingDbContext` method is a helper method
90-
of `AppTestBase` class (which we inherited this unit test class from).
91-
It's used to easily get a reference to `DbContext` and use it directly to
92-
perform database operations.
93-
94-
This method successfully works since all required fields are supplied.
95-
Let's try to create a test for **invalid arguments**:
87+
Test method also written using **async/await** pattern since calling method is async. We called `CreatePerson` method, then checked if given person is in the database. `UsingDbContext` method is a helper method of `AppTestBase` class (which we inherited this unit test class from). It's used to easily get a reference to `DbContext` and use it directly to perform database operations. This method successfully works since all required fields are supplied. Let's try to create a test for **invalid arguments**:
9688

9789
```csharp
9890
[Fact]
@@ -323,7 +315,7 @@ In this blog post, we covered two important functionalities in the phone book ap
323315
* Creating a new person with ASP.NET Zero and DevExtreme Angular.
324316
* Adding a `CreatePerson` method to the `PersonAppService`.
325317
* Testing the `CreatePerson` method with valid and invalid arguments.
326-
* Adding the **ability** to create a new person in the c**lient-side** application.
318+
* Adding the **ability** to create a new person in the **client-side** application.
327319
* Deleting a person from the phone book.
328320
* Implementing the `DeletePerson` method in the `PersonAppService`.
329321
* Updating the client-side service proxies and UI for deleting a person.

blog-posts/en/using-asp.net-zero-with-devextreme-angular-part-4.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,7 @@ We have built a fully functional application until here. Now, we will see how to
169169

170170
### Enable Multi Tenancy
171171

172-
We disabled multi-tenancy at the beginning of this document. Now,
173-
**re-enabling** it in `PhoneBookDemoConsts` class:
172+
We disabled multi-tenancy at the beginning of this document. Now, **re-enabling** it in `PhoneBookDemoConsts` class:
174173

175174
```csharp
176175
public const bool MultiTenancyEnabled = true;

0 commit comments

Comments
 (0)