Browse Source

Merge branch 'master' of https://github.com/volosoft/abp

pull/335/head
Alper Ebicoglu 8 years ago
parent
commit
a7ff2b05d9
  1. 2
      common.props
  2. 20
      docs/Tutorials/AspNetCore-Mvc/Part-I.md
  3. 10
      docs/Tutorials/AspNetCore-Mvc/Part-II.md
  4. 205
      docs/Tutorials/AspNetCore-Mvc/Part-III.md
  5. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-add-create-dialog.png
  6. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-add-edit-dialog.png
  7. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-add-index-page.png
  8. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-book-list.png
  9. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-books-table-actions.png
  10. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-books-table.png
  11. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-create-dialog.png
  12. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-create-template.png
  13. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-homepage.png
  14. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-index-js-file.png
  15. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-localization-files.png
  16. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-menu-items.png
  17. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-new-book-button.png
  18. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-pmc-add-book-migration.png
  19. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-swagger.png
  20. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-test-js-proxy-getlist.png
  21. BIN
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-test-projects.png
  22. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-user-management.png
  23. 0
      docs/Tutorials/AspNetCore-Mvc/images/bookstore-visual-studio-solution.png
  24. 12
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalTagHelperService.cs
  25. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Alerts.cshtml
  26. 12
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Badges.cshtml
  27. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Blockquotes.cshtml
  28. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Borders.cshtml
  29. 12
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Breadcrumbs.cshtml
  30. 57
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Buttons.cshtml
  31. 25
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Cards.cshtml
  32. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Carousel.cshtml
  33. 10
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Collapse.cshtml
  34. 18
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Dropdowns.cshtml
  35. 8
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/DynamicForms.cshtml
  36. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Grids.cshtml
  37. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Images.cshtml
  38. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/ListGroup.cshtml
  39. 17
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Modals.cshtml
  40. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Navs.cshtml
  41. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Paginator.cshtml
  42. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Popovers.cshtml
  43. 12
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/ProgressBars.cshtml
  44. 54
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tables.cshtml
  45. 14
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tabs.cshtml
  46. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tooltips.cshtml
  47. 3
      framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/wwwroot/css/demo.scss
  48. 7
      modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj
  49. 11
      modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj
  50. 13
      modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Volo.Abp.TenantManagement.Web.csproj
  51. 70
      samples/BookStore/test/Acme.BookStore.Application.Tests/BookAppService_Tests.cs
  52. 32
      samples/BookStore/test/Acme.BookStore.Application.Tests/BookStoreTestDataBuilder.cs

2
common.props

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.3.4</Version>
<Version>0.3.5</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<PackageIconUrl>http://www.aspnetboilerplate.com/images/abp_nupkg.png</PackageIconUrl>
<PackageProjectUrl>http://abp.io</PackageProjectUrl>

20
docs/Tutorials/AspNetCore-Mvc/Part-I.md

@ -20,7 +20,7 @@ This tutorial assumes that you have created a new project, named `Acme.BookStore
This is the layered solution structure created from the startup template:
![bookstore-visual-studio-solution](../../images/bookstore-visual-studio-solution.png)
![bookstore-visual-studio-solution](images/bookstore-visual-studio-solution.png)
### Create the Book Entity
@ -95,7 +95,7 @@ public class BookStoreDbContext : AbpDbContext<BookStoreDbContext>
Startup template uses [EF Core Code First Migrations](https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/) to create and maintain the database schema. Open the **Package Manager Console (PMC)**, select the `Acme.BookStore.EntityFrameworkCore` as the **default project** and execute the following command:
![bookstore-pmc-add-book-migration](../../images/bookstore-pmc-add-book-migration.png)
![bookstore-pmc-add-book-migration](images/bookstore-pmc-add-book-migration.png)
This will create a new migration class inside the `Migrations` folder. Then execute the `Update-Database` command to update the database schema:
@ -107,7 +107,7 @@ PM> Update-Database
`Update-Database` command created the `Books` table in the database. Enter a few sample rows, so you can show them on the page:
![bookstore-books-table](../../images/bookstore-books-table.png)
![bookstore-books-table](images/bookstore-books-table.png)
### Create the Application Service
@ -247,7 +247,7 @@ ABP can automatically configures your application services as MVC API Controller
The startup template is configured to run the [swagger UI](https://swagger.io/tools/swagger-ui/) using the [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore) library. Run the application and enter `http://localhost:53929/swagger/` as URL on your browser:
![bookstore-swagger](../../images/bookstore-swagger.png)
![bookstore-swagger](images/bookstore-swagger.png)
You will see some built-in service endpoints as well as the `Book` service and its REST-style endpoints.
@ -273,7 +273,7 @@ acme.bookStore.book.getList({}).done(function (result) { console.log(result); })
Running this code produces such an output:
![bookstore-test-js-proxy-getlist](../../images/bookstore-test-js-proxy-getlist.png)
![bookstore-test-js-proxy-getlist](images/bookstore-test-js-proxy-getlist.png)
You can see the **book list** returned from the server.
@ -297,7 +297,7 @@ It's time to create something visible! Instead of classic MVC, we will use the n
Create a new `Books` folder under the `Pages` folder of the `Acme.BookStore.Web` project and add a new Razor Page named `Index.html`:
![bookstore-add-index-page](../../images/bookstore-add-index-page.png)
![bookstore-add-index-page](images/bookstore-add-index-page.png)
Open the `Index.cshtml` and change the content as shown below:
@ -327,7 +327,7 @@ context.Menu.AddItem(
Localization texts are located under the `Localization/BookStore` folder of the `Acme.BookStore.Domain` project:
![bookstore-localization-files](../../images/bookstore-localization-files.png)
![bookstore-localization-files](images/bookstore-localization-files.png)
Open the `en.json` file and add localization texts for `Menu:BookStore` and `Menu:Books` keys:
@ -347,7 +347,7 @@ Open the `en.json` file and add localization texts for `Menu:BookStore` and `Men
Run the application and see the menu items are added to the top bar:
![bookstore-menu-items](../../images/bookstore-menu-items.png)
![bookstore-menu-items](images/bookstore-menu-items.png)
When you click to the Books menu item, you are redirected to the new Books page.
@ -396,7 +396,7 @@ Change the `Pages/Books/Index.cshtml` as following:
Create `index.js` JavaScript file under the `wwwroot/pages/books/` folder:
![bookstore-index-js-file](../../images/bookstore-index-js-file.png)
![bookstore-index-js-file](images/bookstore-index-js-file.png)
`index.js` content is shown below:
@ -436,7 +436,7 @@ $(function() {
The final UI is shown below:
![bookstore-book-list](../../images/bookstore-book-list.png)
![bookstore-book-list](images/bookstore-book-list.png)
### Next Part

10
docs/Tutorials/AspNetCore-Mvc/Part-II.md

@ -16,13 +16,13 @@ You can download the **source code** of the application [from here](https://gith
In this section, you will learn how to create a new modal dialog form to create a new book. The result dialog will be like that:
![bookstore-create-dialog](../../images/bookstore-create-dialog.png)
![bookstore-create-dialog](images/bookstore-create-dialog.png)
#### Create the Modal Form
Create a new razor page, named `CreateModal.cshtml` under the `Pages/Books` folder of the `Acme.BookStore.Web` project:
![bookstore-add-create-dialog](../../images/bookstore-add-create-dialog.png)
![bookstore-add-create-dialog](images/bookstore-add-create-dialog.png)
##### CreateModal.cshtml.cs
@ -110,7 +110,7 @@ Open the `Pages/Books/Index.cshtml` and change the `abp-card-header` tag as show
Just added a **New book** button to the **top right** of the table:
![bookstore-new-book-button](../../images/bookstore-new-book-button.png)
![bookstore-new-book-button](images/bookstore-new-book-button.png)
Open the `wwwroot/pages/books/index.js` and add the following code just after the datatable configuration:
@ -135,7 +135,7 @@ Now, you can **run the application** and add new books using the new modal form.
Create a new razor page, named `EditModal.cshtml` under the `Pages/Books` folder of the `Acme.BookStore.Web` project:
![bookstore-add-edit-dialog](../../images/bookstore-add-edit-dialog.png)
![bookstore-add-edit-dialog](images/bookstore-add-edit-dialog.png)
#### EditModal.cshtml.cs
@ -251,7 +251,7 @@ This page is very similar to the `CreateModal.cshtml` except;
We will add a dropdown button ("Actions") for each row of the table. The final UI looks like this:
![bookstore-books-table-actions](../../images/bookstore-books-table-actions.png)
![bookstore-books-table-actions](images/bookstore-books-table-actions.png)
Open the `Pages/Books/Index.cshtml` page and change the table section as shown below:

205
docs/Tutorials/AspNetCore-Mvc/Part-III.md

@ -12,4 +12,207 @@ This is the third part of the tutorial series. See all parts:
You can download the **source code** of the application [from here](https://github.com/volosoft/abp/tree/master/samples/BookStore).
TODO...
### Test Projects in the Solution
There are two test projects in the solution:
![bookstore-test-projects](images/bookstore-test-projects.png)
* `Acme.BookStore.Application.Tests` is for unit & integration test projects. You can write tests for application services those are integrated to the framework. It uses **EF Core SQLite in-memory** database.
* `Acme.BookStore.Web.Tests` is for full stack integration tests including the web layer. So, you can write tests for UI too.
Test projects uses the following libraries for testing:
* [xunit](https://xunit.github.io/) as the main test framework.
* [Shoudly](http://shouldly.readthedocs.io/en/latest/) as an assertion library.
* [NSubstitute](http://nsubstitute.github.io/) as a mocking library.
### Adding Test Data
Startup template contains the `BookStoreTestDataBuilder` class in the `Acme.BookStore.Application.Tests` project that creates some data to run tests on. It's shown below:
````C#
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Identity;
using Volo.Abp.Threading;
namespace Acme.BookStore
{
public class BookStoreTestDataBuilder : ITransientDependency
{
private readonly IIdentityDataSeeder _identityDataSeeder;
public BookStoreTestDataBuilder(IIdentityDataSeeder identityDataSeeder)
{
_identityDataSeeder = identityDataSeeder;
}
public void Build()
{
AsyncHelper.RunSync(BuildInternalAsync);
}
public async Task BuildInternalAsync()
{
await _identityDataSeeder.SeedAsync("1q2w3E*");
}
}
}
````
* It simply uses `IIdentityDataSeeder` which is implemented by the identity module and creates an admin role and admin user. You can use them in the tests.
Change the `BookStoreTestDataBuilder` class as show below:
````C#
using System;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Identity;
using Volo.Abp.Threading;
namespace Acme.BookStore
{
public class BookStoreTestDataBuilder : ITransientDependency
{
private readonly IIdentityDataSeeder _identityDataSeeder;
private readonly IRepository<Book, Guid> _bookRepository;
public BookStoreTestDataBuilder(
IIdentityDataSeeder identityDataSeeder,
IRepository<Book, Guid> bookRepository)
{
_identityDataSeeder = identityDataSeeder;
_bookRepository = bookRepository;
}
public void Build()
{
AsyncHelper.RunSync(BuildInternalAsync);
}
public async Task BuildInternalAsync()
{
await _identityDataSeeder.SeedAsync("1q2w3E*");
await _bookRepository.InsertAsync(
new Book
{
Id = Guid.NewGuid(),
Name = "Test book 1",
Type = BookType.Fantastic,
PublishDate = new DateTime(2015, 05, 24),
Price = 21
}
);
await _bookRepository.InsertAsync(
new Book
{
Id = Guid.NewGuid(),
Name = "Test book 2",
Type = BookType.Science,
PublishDate = new DateTime(2014, 02, 11),
Price = 15
}
);
}
}
}
````
* Injected `IRepository<Book, Guid>` and used it in the `BuildInternalAsync` to create 2 book entities.
### Testing the BookAppService
Create a test class named `BookAppService_Tests` in the `Acme.BookStore.Application.Tests` project:
````C#
using System.Threading.Tasks;
using Shouldly;
using Volo.Abp.Application.Dtos;
using Xunit;
namespace Acme.BookStore
{
public class BookAppService_Tests : BookStoreApplicationTestBase
{
private readonly IBookAppService _bookAppService;
public BookAppService_Tests()
{
_bookAppService = GetRequiredService<IBookAppService>();
}
[Fact]
public async Task Should_Get_List_Of_Books()
{
//Act
var result = await _bookAppService.GetListAsync(
new PagedAndSortedResultRequestDto()
);
//Assert
result.TotalCount.ShouldBeGreaterThan(0);
result.Items.ShouldContain(b => b.Name == "Test book 1");
}
}
}
````
* `Should_Get_List_Of_Books` test simply uses `BookAppService.GetListAsync` method to get and check the list of users.
Add a new test that creates a valid new book:
````C#
[Fact]
public async Task Should_Create_A_Valid_Book()
{
//Act
var result = await _bookAppService.CreateAsync(
new CreateUpdateBookDto
{
Name = "New test book 42",
Price = 10,
PublishDate = DateTime.Now,
Type = BookType.ScienceFiction
}
);
//Assert
result.Id.ShouldNotBe(Guid.Empty);
result.Name.ShouldBe("New test book 42");
}
````
Add a new test that tries to create an invalid book and fails:
````C#
[Fact]
public async Task Should_Not_Create_A_Book_Without_Name()
{
var exception = await Assert.ThrowsAsync<AbpValidationException>(async () =>
{
await _bookAppService.CreateAsync(
new CreateUpdateBookDto
{
Name = "",
Price = 10,
PublishDate = DateTime.Now,
Type = BookType.ScienceFiction
}
);
});
exception.ValidationErrors
.ShouldContain(err => err.MemberNames.Any(mem => mem == "Name"));
}
````
* Since the `Name` is set as empty, ABP throws an `AbpValidationException`.
### Testing Web Pages
TODO

0
docs/images/bookstore-add-create-dialog.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-add-create-dialog.png

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

0
docs/images/bookstore-add-edit-dialog.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-add-edit-dialog.png

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

0
docs/images/bookstore-add-index-page.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-add-index-page.png

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.5 KiB

0
docs/images/bookstore-book-list.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-book-list.png

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

0
docs/images/bookstore-books-table-actions.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-books-table-actions.png

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

0
docs/images/bookstore-books-table.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-books-table.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
docs/images/bookstore-create-dialog.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-create-dialog.png

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

0
docs/images/bookstore-create-template.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-create-template.png

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

0
docs/images/bookstore-homepage.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-homepage.png

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

0
docs/images/bookstore-index-js-file.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-index-js-file.png

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

0
docs/images/bookstore-localization-files.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-localization-files.png

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

0
docs/images/bookstore-menu-items.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-menu-items.png

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

0
docs/images/bookstore-new-book-button.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-new-book-button.png

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

0
docs/images/bookstore-pmc-add-book-migration.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-pmc-add-book-migration.png

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

0
docs/images/bookstore-swagger.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-swagger.png

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

0
docs/images/bookstore-test-js-proxy-getlist.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-test-js-proxy-getlist.png

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

BIN
docs/Tutorials/AspNetCore-Mvc/images/bookstore-test-projects.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

0
docs/images/bookstore-user-management.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-user-management.png

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

0
docs/images/bookstore-visual-studio-solution.png → docs/Tutorials/AspNetCore-Mvc/images/bookstore-visual-studio-solution.png

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

12
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap/TagHelpers/Modal/AbpModalTagHelperService.cs

@ -1,4 +1,5 @@
using System.Text;
using System.Linq;
using System.Text;
using Microsoft.AspNetCore.Razor.TagHelpers;
namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
@ -8,15 +9,18 @@ namespace Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal
public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.TagName = null;
output.PreContent.SetHtmlContent(CreatePreContent());
output.PreContent.SetHtmlContent(CreatePreContent(output));
output.PostContent.SetHtmlContent(CreatePostContent());
}
protected virtual string CreatePreContent()
protected virtual string CreatePreContent(TagHelperOutput output)
{
var sb = new StringBuilder();
sb.AppendLine("<div class=\""+ GetModalClasses() + "\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\">");
var attritubutes = output.Attributes.Select(a => " " + a.Name + "=\"" + a.Value + "\" ").ToList();
var attritubutesAsJoin = string.Join(" ", attritubutes.ToArray());
sb.AppendLine("<div class=\""+ GetModalClasses() + "\" tabindex=\"-1\" role=\"dialog\" aria-hidden=\"true\" "+ attritubutesAsJoin + ">");
sb.AppendLine(" <div class=\"" + GetModalDialogClasses() + "\" role=\"document\">");
sb.AppendLine(" <div class=\"" + GetModalContentClasses() + "\">");

6
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Alerts.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Alerts";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Alerts</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/alerts/" target="_blank"> Bootstrap Alert</a>.</p>

12
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Badges.cshtml

@ -4,17 +4,23 @@
ViewData["Title"] = "Badges";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Badges</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/badges/" target="_blank"> Bootstrap Badge</a>.</p>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/badge/" target="_blank"> Bootstrap Badge</a>.</p>
<h4># Badges Examples</h4>
<div class="demo-with-code">
<div class="demo-area">
<span abp-badge="Primary" >I'm an abp badge!</span>
<span abp-badge-pill="Warning" >I'm an abp pill badge!</span>
<span abp-badge="Primary">I'm an abp badge!</span>
<span abp-badge-pill="Warning">I'm an abp pill badge!</span>
<a abp-badge="Danger" href="#">I'm an abp badge link!</a>
<a abp-badge-pill="Success" href="#">I'm an abp pill badge link!</a>

6
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Blockquotes.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Badges";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Blockquotes</h2>
<p>Based on <a href="http://getbootstrap.com/docs/4.1/content/typography/#blockquotes" target="_blank"> Bootstrap Blockquotes</a>.</p>

6
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Borders.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Borders";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Borders</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/border/" target="_blank"> Bootstrap Border</a>.</p>

12
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Breadcrumbs.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Breadcrumbs";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Breadcrumbs</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/breadcrumbs/" target="_blank"> Bootstrap Breadcrumb</a>.</p>
@ -14,9 +20,9 @@
<div class="demo-area">
<abp-breadcrumb>
<abp-breadcrumb-item href="#" title="Home"/>
<abp-breadcrumb-item href="#" title="Library"/>
<abp-breadcrumb-item title="Page"/>
<abp-breadcrumb-item href="#" title="Home" />
<abp-breadcrumb-item href="#" title="Library" />
<abp-breadcrumb-item title="Page" />
</abp-breadcrumb>
</div>

57
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Buttons.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Buttons";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Buttons</h2>
<p>Based on <a href="http://getbootstrap.com/docs/4.1/components/buttons/" target="_blank"> Bootstrap button</a>.</p>
@ -12,7 +18,7 @@
<div class="demo-with-code">
<div class="demo-area">
<abp-button>Default</abp-button>
<abp-button text="Default" />
<abp-button button-type="Primary">Primary</abp-button>
<abp-button button-type="Secondary">Secondary</abp-button>
<abp-button button-type="Success">Success</abp-button>
@ -25,7 +31,7 @@
</div>
<div class="code-area">
<pre>
&lt;abp-button&gt;Default&lt;/abp-button&gt;
&lt;abp-button text=&quot;Default&quot;/&gt;
&lt;abp-button button-type="Primary"&gt;Primary&lt;/abp-button&gt;
&lt;abp-button button-type="Secondary"&gt;Secondary&lt;/abp-button&gt;
&lt;abp-button button-type="Success"&gt;Success&lt;/abp-button&gt;
@ -42,9 +48,9 @@
<h4># Example</h4>
<div class="demo-with-code">
<div class="demo-area">
<div class="demo-area" style="margin: 35px;">
<a abp-button="Primary" href="#">Link</a>
<abp-button button-type="Primary" type="submit">Button</abp-button>
<abp-button button-type="Primary" type="submit" text="Button" />
<input abp-button="Primary" value="Input" />
<input abp-button="Primary" type="submit" value="Submit" />
<input abp-button="Primary" type="reset" value="Reset" />
@ -52,10 +58,51 @@
<div class="code-area">
<pre>
&lt;a abp-button="Primary" href="#"&gt;Link&lt;/a&gt;
&lt;abp-button button-type="Primary" type="submit"&gt;Button&lt;/abp-button&gt;
&lt;abp-button button-type=&quot;Primary&quot; type=&quot;submit&quot; text=&quot;Button&quot;/&gt;
&lt;input abp-button="Primary" value="Input" /&gt;
&lt;input abp-button="Primary" type="submit" value="Submit" /&gt;
&lt;input abp-button="Primary" type="reset" value="Reset" /&gt;
</pre>
</div>
</div>
<h4># Example</h4>
<div class="demo-with-code">
<div class="demo-area">
<abp-button size="Large" text="Large" />
<abp-button size="Small" text="Small" />
</div>
<div class="code-area">
<pre>
&lt;abp-button size=&quot;Large&quot; text=&quot;Large&quot;/&gt;
&lt;abp-button size=&quot;Small&quot; text=&quot;Small&quot;/&gt;
</pre>
</div>
</div>
<h4># Example</h4>
<div class="demo-with-code">
<div class="demo-area">
<abp-button icon-type="FontAwesome" icon="info" text="With Icon" />
</div>
<div class="code-area">
<pre>
&lt;abp-button icon-type=&quot;FontAwesome&quot; icon=&quot;info&quot; text=&quot;With Icon&quot;/&gt;
</pre>
</div>
</div>
<h4># Example</h4>
<div class="demo-with-code">
<div class="demo-area">
<abp-button text="Busy" busy-text="Saving..." />
</div>
<div class="code-area">
<pre>
&lt;abp-button text=&quot;Busy&quot; busy-text=&quot;Saving...&quot;/&gt;
</pre>
</div>
</div>

25
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Cards.cshtml

@ -4,19 +4,14 @@
ViewData["Title"] = "Cards";
}
<h2>Cards</h2>
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
@*
<h4># Example</h4>
<h2>Cards</h2>
<div class="demo-with-code">
<div class="demo-area">
</div>
<div class="code-area">
<pre></pre>
</div>
</div>
*@
<p>Based on <a href="http://getbootstrap.com/docs/4.1/components/card/" target="_blank"> Bootstrap card</a>.</p>
@ -100,10 +95,10 @@
<a class="nav-link active" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
<a class="nav-link" href="#link">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
<a class="nav-link disabled" href="#disabledlink">Disabled</a>
</li>
</ul>
</abp-card-header>
@ -122,10 +117,10 @@
&lt;a class="nav-link active" href="#"&gt;Active&lt;/a&gt;
&lt;/li&gt;
&lt;li class="nav-item"&gt;
&lt;a class="nav-link" href="#"&gt;Link&lt;/a&gt;
&lt;a class="nav-link" href="#link"&gt;Link&lt;/a&gt;
&lt;/li&gt;
&lt;li class="nav-item"&gt;
&lt;a class="nav-link disabled" href="#"&gt;Disabled&lt;/a&gt;
&lt;a class="nav-link disabled" href="#disabledlink"&gt;Disabled&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/abp-card-header&gt;

6
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Carousel.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Carousels";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Carousels</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/content/images/" target="_blank"> Bootstrap Carousel</a>.</p>

10
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Collapse.cshtml

@ -5,6 +5,12 @@
ViewData["Title"] = "Collapse";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Collapse</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/collapse/" target="_blank"> Bootstrap Collapse</a>.</p>
@ -48,13 +54,13 @@
<div class="demo-with-code">
<div class="demo-area">
<p>
<abp-collapse-button buton-type="Success" body-id="collapseExample">
Toggle
</abp-collapse-button>
</p>
<abp-collapse-body id="collapseExample" show="true">
3Anim pariatur wolf moon tempor,,, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</abp-collapse-body>

18
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Dropdowns.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Dropdowns";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Dropdowns</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/dropdowns/" target="_blank"> Bootstrap button</a>.</p>
@ -14,13 +20,13 @@
<div class="demo-area">
<abp-dropdown>
<abp-dropdown-button button-type="Primary" text="Dropdown"/>
<abp-dropdown-button button-type="Primary" text="Dropdown" />
<abp-dropdown-menu>
<abp-dropdown-header>Dropdown header</abp-dropdown-header>
<abp-dropdown-item href="#" active="true">Action</abp-dropdown-item>
<abp-dropdown-item href="#" disabled="true">Another disabled action</abp-dropdown-item>
<abp-dropdown-item href="#">Something else here</abp-dropdown-item>
<abp-dropdown-divider/>
<abp-dropdown-divider />
<abp-dropdown-item href="#">Separated link</abp-dropdown-item>
</abp-dropdown-menu>
</abp-dropdown>
@ -49,13 +55,13 @@
<div class="demo-area">
<abp-dropdown direction="Right">
<abp-dropdown-button dropdown-style="Split" button-type="Danger" text="Dropdown"/>
<abp-dropdown-button dropdown-style="Split" button-type="Danger" text="Dropdown" />
<abp-dropdown-menu>
<abp-dropdown-header>Dropdown header</abp-dropdown-header>
<abp-dropdown-item href="#" active="true">Action</abp-dropdown-item>
<abp-dropdown-item href="#" disabled="true">Another disabled action</abp-dropdown-item>
<abp-dropdown-item href="#">Something else here</abp-dropdown-item>
<abp-dropdown-divider/>
<abp-dropdown-divider />
<abp-dropdown-item href="#">Separated link</abp-dropdown-item>
</abp-dropdown-menu>
</abp-dropdown>
@ -84,13 +90,13 @@
<div class="demo-area">
<abp-dropdown direction="Up">
<abp-dropdown-button Link="true" button-type="Primary" text="Dropdown"/>
<abp-dropdown-button Link="true" button-type="Primary" text="Dropdown" />
<abp-dropdown-menu align="Right">
<abp-dropdown-header>Dropdown header</abp-dropdown-header>
<abp-dropdown-item href="#" active="true">Action</abp-dropdown-item>
<abp-dropdown-item href="#" disabled="true">Another disabled action</abp-dropdown-item>
<abp-dropdown-item href="#">Something else here</abp-dropdown-item>
<abp-dropdown-divider/>
<abp-dropdown-divider />
<abp-dropdown-item href="#">Separated link</abp-dropdown-item>
</abp-dropdown-menu>
</abp-dropdown>

8
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/DynamicForms.cshtml

@ -6,13 +6,19 @@
ViewData["Title"] = "Forms";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Dynamic Forms</h2>
<h4># Dynamic Form Example</h4>
<div class="demo-with-code">
<div class="demo-area">
<abp-dynamic-form abp-model="@Model.PersonInput"/>
<abp-dynamic-form abp-model="@Model.PersonInput" />
<hr />
<h5>Posted Values:</h5>
<div>

6
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Grids.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Grids";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Grids</h2>
<p>Based on <a href="http://getbootstrap.com/docs/4.1/layout/grid/" target="_blank"> Bootstrap grid</a>.</p>

6
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Images.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Images";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Images</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/content/images/" target="_blank"> Bootstrap Images</a>.</p>

6
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/ListGroup.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "List Groups";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>List Groups</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/list-group/" target="_blank"> Bootstrap List Group</a>.</p>

17
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Modals.cshtml

@ -5,19 +5,26 @@
ViewData["Title"] = "Modals";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Modals</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/modals/" target="_blank"> Bootstrap Modal</a>.</p>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/modal/" target="_blank"> Bootstrap Modal</a>.</p>
<h4># Modal Example</h4>
<div class="demo-with-code">
<div class="demo-area">
<abp-button button-type="Success" data-toggle="modal" data-target="#myModal">Launch modal</abp-button>
<abp-modal id="myModal">
<abp-modal>
<abp-modal-header title="Header"></abp-modal-header>
<abp-modal-body>
Body
</abp-modal-body>
@ -29,7 +36,7 @@
</div>
<div class="code-area">
<pre>
&lt;abp-modal&gt;
&lt;abp-modal id=&quot;myModal&quot;&gt;
&lt;abp-modal-header title=&quot;Header&quot;&gt;&lt;/abp-modal-header&gt;
&lt;abp-modal-body&gt;
Body

6
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Navs.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Navs";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Navs</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/navs/" target="_blank"> Bootstrap Navs</a>.</p>

6
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Paginator.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Paginator";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Paginator</h2>
<h4># Paginator Examples</h4>

6
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Popovers.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Badges";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Popovers</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/Popovers/" target="_blank"> Bootstrap Popovers</a>.</p>

12
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/ProgressBars.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Progress Bars";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Progress Bars</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/progress/" target="_blank"> Bootstrap Progress Bars</a>.</p>
@ -14,8 +20,8 @@
<div class="demo-area">
<abp-progress>
<abp-progress-bar value="70"/>
<abp-progress-bar value="70" />
</abp-progress>
<br />
<abp-progress>
@ -30,7 +36,7 @@
</abp-progress>
<br />
<abp-progress>
<abp-progress-bar type="Dark" value="10" min-value="5" max-value="15" strip="true">
<abp-progress-bar type="Dark" value="10" min-value="5" max-value="15" strip="true">
%50
</abp-progress-bar>
</abp-progress>

54
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tables.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Tables";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Tables</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/content/Tables/" target="_blank"> Bootstrap Tables</a>.</p>
@ -15,32 +21,32 @@
<abp-table striped-rows="true" hoverable-rows="true" responsive-sm="true">
<thead theme="Dark">
<tr>
<th scope="Column">#</th>
<th scope="Column">First</th>
<th scope="Column">Last</th>
<th scope="Column">Handle</th>
</tr>
<tr>
<th scope="Column">#</th>
<th scope="Column">First</th>
<th scope="Column">Last</th>
<th scope="Column">Handle</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="Row">1</th>
<td>Mark</td>
<td>Otto</td>
<td abp-table-style="Danger">mdo</td>
</tr>
<tr abp-table-style="Warning">
<th scope="Row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>fat</td>
</tr>
<tr>
<th scope="Row">3</th>
<td abp-table-style="Success">Larry</td>
<td>the Bird</td>
<td>twitter</td>
</tr>
<tr>
<th scope="Row">1</th>
<td>Mark</td>
<td>Otto</td>
<td abp-table-style="Danger">mdo</td>
</tr>
<tr abp-table-style="Warning">
<th scope="Row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>fat</td>
</tr>
<tr>
<th scope="Row">3</th>
<td abp-table-style="Success">Larry</td>
<td>the Bird</td>
<td>twitter</td>
</tr>
</tbody>
</abp-table>

14
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tabs.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Tabs";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Tabs</h2>
<p>Based on <a href="http://getbootstrap.com/docs/4.1/components/navs/#tabs" target="_blank"> Bootstrap tab</a>.</p>
@ -15,7 +21,7 @@
<abp-tabs>
<abp-tab title="Home">
Content_Home
</abp-tab>
</abp-tab>
<abp-tab title="profile">
Content_Profile
</abp-tab>
@ -48,7 +54,7 @@
<abp-tabs name="TabId">
<abp-tab name="nav-home" title="Home">
Content_Home
</abp-tab>
</abp-tab>
<abp-tab name="nav-profile" active="true" title="profile">
Content_Profile
</abp-tab>
@ -81,7 +87,7 @@
<abp-tabs tab-style="Pill">
<abp-tab active="true" title="Home">
Content_Home
</abp-tab>
</abp-tab>
<abp-tab title="profile">
Content_Profile
</abp-tab>
@ -114,7 +120,7 @@
<abp-tabs tab-style="PillVertical" vertical-header-size="_2">
<abp-tab active="true" title="Home">
Content_Home
</abp-tab>
</abp-tab>
<abp-tab title="profile">
Content_Profile
</abp-tab>

6
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/Pages/Components/Tooltips.cshtml

@ -4,6 +4,12 @@
ViewData["Title"] = "Badges";
}
@section styles {
<abp-style-bundle>
<abp-style src="/css/demo.css" />
</abp-style-bundle>
}
<h2>Tooltips</h2>
<p>Based on <a href="https://getbootstrap.com/docs/4.1/components/tooltips/" target="_blank"> Bootstrap Tooltips</a>.</p>

3
framework/test/Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.Demo/wwwroot/css/demo.scss

@ -1,15 +1,16 @@
.demo-with-code {
padding-bottom: 10px;
margin-bottom: 10px;
.demo-area {
margin-top: 20px;
margin-bottom: 1em;
}
.code-area {
border: 1px solid #ddd;
padding: 10px;
margin-top: 10px;
font-size: 0.9em;
}
}

7
modules/blogging/src/Volo.Blogging.Web/Volo.Blogging.Web.csproj

@ -28,8 +28,11 @@
</ItemGroup>
<ItemGroup>
<Content Remove="wwwroot\pages\blog\posts\edit.js" />
<Content Remove="wwwroot\pages\blog\posts\new.js" />
<Content Remove="wwwroot\**\*.*" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Localization\Resources\**\*.json" />
<Content Remove="Properties\launchSettings.json" />
<None Include="Properties\launchSettings.json" />
</ItemGroup>
</Project>

11
modules/docs/src/Volo.Docs.Web/Volo.Docs.Web.csproj

@ -22,5 +22,16 @@
<EmbeddedResource Include="wwwroot\**\*.*" />
<EmbeddedResource Include="Pages\**\*.cshtml" Exclude="*.cs" />
</ItemGroup>
<ItemGroup>
<Content Remove="wwwroot\**\*.*" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Localization\Resources\**\*.json" />
<Content Remove="compilerconfig.json" />
<Content Remove="compilerconfig.json.defaults" />
<Content Remove="Properties\launchSettings.json" />
<None Include="compilerconfig.json" />
<None Include="Properties\launchSettings.json" />
</ItemGroup>
</Project>

13
modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Volo.Abp.TenantManagement.Web.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\..\common.props" />
@ -17,6 +17,17 @@
<EmbeddedResource Include="Localization\Resources\AbpTenantManagement\Web\*.json" />
</ItemGroup>
<ItemGroup>
<Content Remove="wwwroot\**\*.*" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Localization\Resources\**\*.json" />
<Content Remove="compilerconfig.json" />
<Content Remove="compilerconfig.json.defaults" />
<Content Remove="Properties\launchSettings.json" />
<None Include="compilerconfig.json" />
<None Include="Properties\launchSettings.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.TenantManagement.HttpApi\Volo.Abp.TenantManagement.HttpApi.csproj" />

70
samples/BookStore/test/Acme.BookStore.Application.Tests/BookAppService_Tests.cs

@ -0,0 +1,70 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Shouldly;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Validation;
using Xunit;
namespace Acme.BookStore
{
public class BookAppService_Tests : BookStoreApplicationTestBase
{
private readonly IBookAppService _bookAppService;
public BookAppService_Tests()
{
_bookAppService = GetRequiredService<IBookAppService>();
}
[Fact]
public async Task Should_Get_List_Of_Books()
{
//Act
var result = await _bookAppService.GetListAsync(new PagedAndSortedResultRequestDto());
//Assert
result.TotalCount.ShouldBeGreaterThan(0);
result.Items.ShouldContain(b => b.Name == "Test book 1");
}
[Fact]
public async Task Should_Create_A_Valid_Book()
{
//Act
var result = await _bookAppService.CreateAsync(
new CreateUpdateBookDto
{
Name = "New test book 42",
Price = 10,
PublishDate = DateTime.Now,
Type = BookType.ScienceFiction
}
);
//Assert
result.Id.ShouldNotBe(Guid.Empty);
result.Name.ShouldBe("New test book 42");
}
[Fact]
public async Task Should_Not_Create_A_Book_Without_Name()
{
var exception = await Assert.ThrowsAsync<AbpValidationException>(async () =>
{
await _bookAppService.CreateAsync(
new CreateUpdateBookDto
{
Name = "",
Price = 10,
PublishDate = DateTime.Now,
Type = BookType.ScienceFiction
}
);
});
exception.ValidationErrors
.ShouldContain(err => err.MemberNames.Any(mem => mem == "Name"));
}
}
}

32
samples/BookStore/test/Acme.BookStore.Application.Tests/BookStoreTestDataBuilder.cs

@ -1,5 +1,7 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Identity;
using Volo.Abp.Threading;
@ -8,10 +10,14 @@ namespace Acme.BookStore
public class BookStoreTestDataBuilder : ITransientDependency
{
private readonly IIdentityDataSeeder _identityDataSeeder;
private readonly IRepository<Book, Guid> _bookRepository;
public BookStoreTestDataBuilder(IIdentityDataSeeder identityDataSeeder)
public BookStoreTestDataBuilder(
IIdentityDataSeeder identityDataSeeder,
IRepository<Book, Guid> bookRepository)
{
_identityDataSeeder = identityDataSeeder;
_bookRepository = bookRepository;
}
public void Build()
@ -22,6 +28,28 @@ namespace Acme.BookStore
public async Task BuildInternalAsync()
{
await _identityDataSeeder.SeedAsync("1q2w3E*");
await _bookRepository.InsertAsync(
new Book
{
Id = Guid.NewGuid(),
Name = "Test book 1",
Type = BookType.Fantastic,
PublishDate = new DateTime(2015, 05, 24),
Price = 21
}
);
await _bookRepository.InsertAsync(
new Book
{
Id = Guid.NewGuid(),
Name = "Test book 2",
Type = BookType.Science,
PublishDate = new DateTime(2014, 02, 11),
Price = 15
}
);
}
}
}
Loading…
Cancel
Save