Skip to content

Commit 28dccba

Browse files
committed
Add Test
1 parent 4a219e0 commit 28dccba

27 files changed

+1161
-0
lines changed

Notifications.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1616
EndProject
1717
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.Extensions.Notifications.JS", "src\Blazor.Extensions.Notifications.JS\Blazor.Extensions.Notifications.JS.csproj", "{1C49147F-7C73-4962-A71C-6A193970D058}"
1818
EndProject
19+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blazor.Extensions.Notifications.Test", "test\Blazor.Extensions.Notifications.Test\Blazor.Extensions.Notifications.Test.csproj", "{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}"
20+
EndProject
1921
Global
2022
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2123
Debug|Any CPU = Debug|Any CPU
@@ -50,13 +52,26 @@ Global
5052
{1C49147F-7C73-4962-A71C-6A193970D058}.Release|x64.Build.0 = Release|Any CPU
5153
{1C49147F-7C73-4962-A71C-6A193970D058}.Release|x86.ActiveCfg = Release|Any CPU
5254
{1C49147F-7C73-4962-A71C-6A193970D058}.Release|x86.Build.0 = Release|Any CPU
55+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
56+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}.Debug|Any CPU.Build.0 = Debug|Any CPU
57+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}.Debug|x64.ActiveCfg = Debug|Any CPU
58+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}.Debug|x64.Build.0 = Debug|Any CPU
59+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}.Debug|x86.ActiveCfg = Debug|Any CPU
60+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}.Debug|x86.Build.0 = Debug|Any CPU
61+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}.Release|Any CPU.ActiveCfg = Release|Any CPU
62+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}.Release|Any CPU.Build.0 = Release|Any CPU
63+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}.Release|x64.ActiveCfg = Release|Any CPU
64+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}.Release|x64.Build.0 = Release|Any CPU
65+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}.Release|x86.ActiveCfg = Release|Any CPU
66+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5}.Release|x86.Build.0 = Release|Any CPU
5367
EndGlobalSection
5468
GlobalSection(SolutionProperties) = preSolution
5569
HideSolutionNode = FALSE
5670
EndGlobalSection
5771
GlobalSection(NestedProjects) = preSolution
5872
{9378C7BF-0899-4835-B8FB-099292C8C63D} = {B286BCBD-DAD8-4DE7-9334-3DE18DF233AF}
5973
{1C49147F-7C73-4962-A71C-6A193970D058} = {B286BCBD-DAD8-4DE7-9334-3DE18DF233AF}
74+
{FD4DBABD-EC5B-4A75-BEEA-B9339B336ED5} = {20DAA632-F8AD-4C5F-9E5F-FC82B7CB56A7}
6075
EndGlobalSection
6176
GlobalSection(ExtensibilityGlobals) = postSolution
6277
SolutionGuid = {A97C0A4B-E309-4485-BB76-898B37BFBFFF}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!--
2+
Configuring this here is temporary. Later we'll move the app config
3+
into Program.cs, and it won't be necessary to specify AppAssembly.
4+
-->
5+
<Router AppAssembly=typeof(Program).Assembly />
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netstandard2.0</TargetFramework>
5+
<RunCommand>dotnet</RunCommand>
6+
<RunArguments>blazor serve</RunArguments>
7+
<LangVersion>7.3</LangVersion>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="Microsoft.AspNetCore.Blazor.Browser" Version="0.6.0" />
12+
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.6.0" PrivateAssets="all" />
13+
14+
<DotNetCliToolReference Include="Microsoft.AspNetCore.Blazor.Cli" Version="0.6.0" />
15+
</ItemGroup>
16+
17+
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@page "/counter"
2+
3+
<h1>Counter</h1>
4+
5+
<p>Current count: @currentCount</p>
6+
7+
<button class="btn btn-primary" onclick="@IncrementCount">Click me</button>
8+
9+
@functions {
10+
int currentCount = 0;
11+
12+
void IncrementCount()
13+
{
14+
currentCount++;
15+
}
16+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
@page "/fetchdata"
2+
@inject HttpClient Http
3+
4+
<h1>Weather forecast</h1>
5+
6+
<p>This component demonstrates fetching data from the server.</p>
7+
8+
@if (forecasts == null)
9+
{
10+
<p><em>Loading...</em></p>
11+
}
12+
else
13+
{
14+
<table class="table">
15+
<thead>
16+
<tr>
17+
<th>Date</th>
18+
<th>Temp. (C)</th>
19+
<th>Temp. (F)</th>
20+
<th>Summary</th>
21+
</tr>
22+
</thead>
23+
<tbody>
24+
@foreach (var forecast in forecasts)
25+
{
26+
<tr>
27+
<td>@forecast.Date.ToShortDateString()</td>
28+
<td>@forecast.TemperatureC</td>
29+
<td>@forecast.TemperatureF</td>
30+
<td>@forecast.Summary</td>
31+
</tr>
32+
}
33+
</tbody>
34+
</table>
35+
}
36+
37+
@functions {
38+
WeatherForecast[] forecasts;
39+
40+
protected override async Task OnInitAsync()
41+
{
42+
forecasts = await Http.GetJsonAsync<WeatherForecast[]>("sample-data/weather.json");
43+
}
44+
45+
class WeatherForecast
46+
{
47+
public DateTime Date { get; set; }
48+
public int TemperatureC { get; set; }
49+
public int TemperatureF { get; set; }
50+
public string Summary { get; set; }
51+
}
52+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@page "/"
2+
3+
<h1>Hello, world!</h1>
4+
5+
Welcome to your new app.
6+
7+
<SurveyPrompt Title="How is Blazor working for you?" />
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@layout MainLayout
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Microsoft.AspNetCore.Blazor.Hosting;
2+
3+
namespace Blazor.Extensions.Notifications.Test
4+
{
5+
public class Program
6+
{
7+
public static void Main(string[] args)
8+
{
9+
CreateHostBuilder(args).Build().Run();
10+
}
11+
12+
public static IWebAssemblyHostBuilder CreateHostBuilder(string[] args) =>
13+
BlazorWebAssemblyHost.CreateDefaultBuilder()
14+
.UseBlazorStartup<Startup>();
15+
}
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
@inherits BlazorLayoutComponent
2+
3+
<div class="sidebar">
4+
<NavMenu />
5+
</div>
6+
7+
<div class="main">
8+
<div class="top-row px-4">
9+
<a href="http://blazor.net" target="_blank" class="ml-md-auto">About</a>
10+
</div>
11+
12+
<div class="content px-4">
13+
@Body
14+
</div>
15+
</div>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<div class="top-row pl-4 navbar navbar-dark">
2+
<a class="navbar-brand" href="">Blazor.Extensions.Notifications.Test</a>
3+
<button class="navbar-toggler" onclick=@ToggleNavMenu>
4+
<span class="navbar-toggler-icon"></span>
5+
</button>
6+
</div>
7+
8+
<div class=@(collapseNavMenu ? "collapse" : null) onclick=@ToggleNavMenu>
9+
<ul class="nav flex-column">
10+
<li class="nav-item px-3">
11+
<NavLink class="nav-link" href="" Match=NavLinkMatch.All>
12+
<span class="oi oi-home" aria-hidden="true"></span> Home
13+
</NavLink>
14+
</li>
15+
<li class="nav-item px-3">
16+
<NavLink class="nav-link" href="counter">
17+
<span class="oi oi-plus" aria-hidden="true"></span> Counter
18+
</NavLink>
19+
</li>
20+
<li class="nav-item px-3">
21+
<NavLink class="nav-link" href="fetchdata">
22+
<span class="oi oi-list-rich" aria-hidden="true"></span> Fetch data
23+
</NavLink>
24+
</li>
25+
</ul>
26+
</div>
27+
28+
@functions {
29+
bool collapseNavMenu = true;
30+
31+
void ToggleNavMenu()
32+
{
33+
collapseNavMenu = !collapseNavMenu;
34+
}
35+
}

0 commit comments

Comments
 (0)