Skip to content

Commit 1a21a10

Browse files
committed
.
1 parent 5597f3f commit 1a21a10

25 files changed

Lines changed: 847 additions & 14 deletions

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: SimonCropp
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug fix
3+
about: Create a bug fix to help us improve
4+
---
5+
6+
Note: New issues raised, where it is clear the submitter has not read the issue template, are likely to be closed with "please read the issue template". Please don't take offense at this. It is simply a time management decision. If someone raises an issue, and can't be bothered to spend the time to read the issue template, then the project maintainers should not be expected to spend the time to read the submitted issue. Often too much time is spent going back and forth in issue comments asking for information that is outlined in the issue template.
7+
8+
9+
#### Preamble
10+
11+
General questions may be better placed [StackOveflow](https://stackoverflow.com/).
12+
13+
Where relevant, ensure you are using the current stable versions on your development stack. For example:
14+
15+
* Visual Studio
16+
* [.NET SDK or .NET Core SDK](https://www.microsoft.com/net/download)
17+
* Any related NuGet packages
18+
19+
Any code or stack traces must be properly formatted with [GitHub markdown](https://guides.github.com/features/mastering-markdown/).
20+
21+
22+
#### Describe the bug
23+
24+
A clear and concise description of what the bug is. Include any relevant version information.
25+
26+
A clear and concise description of what you expected to happen.
27+
28+
Add any other context about the problem here.
29+
30+
31+
#### Minimal Repro
32+
33+
Ensure you have replicated the bug in a minimal solution with the fewest moving parts. Often this will help point to the true cause of the problem. Upload this repro as part of the issue, preferably a public GitHub repository or a downloadable zip. The repro will allow the maintainers of this project to smoke test the any fix.
34+
35+
#### Submit a PR that fixes the bug
36+
37+
Submit a [Pull Request (PR)](https://help.github.com/articles/about-pull-requests/) that fixes the bug. Include in this PR a test that verifies the fix. If you were not able to fix the bug, a PR that illustrates your partial progress will suffice.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Feature request
3+
about: How to raise feature requests
4+
---
5+
6+
7+
Note: New issues raised, where it is clear the submitter has not read the issue template, are likely to be closed with "please read the issue template". Please don't take offense at this. It is simply a time management decision. If someone raises an issue, and can't be bothered to spend the time to read the issue template, then the project maintainers should not be expected to spend the time to read the submitted issue. Often too much time is spent going back and forth in issue comments asking for information that is outlined in the issue template.
8+
9+
If you are certain the feature will be accepted, it is better to raise a [Pull Request (PR)](https://help.github.com/articles/about-pull-requests/).
10+
11+
If you are uncertain if the feature will be accepted, outline the proposal below to confirm it is viable, prior to raising a PR that implements the feature.
12+
13+
Note that even if the feature is a good idea and viable, it may not be accepted since the ongoing effort in maintaining the feature may outweigh the benefit it delivers.
14+
15+
16+
#### Is the feature request related to a problem
17+
18+
A clear and concise description of what the problem is.
19+
20+
21+
#### Describe the solution
22+
23+
A clear and concise proposal of how you intend to implement the feature.
24+
25+
26+
#### Describe alternatives considered
27+
28+
A clear and concise description of any alternative solutions or features you've considered.
29+
30+
31+
#### Additional context
32+
33+
Add any other context about the feature request here.

.gitignore

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
# Build and Release Folders
2-
bin-debug/
3-
bin-release/
4-
[Oo]bj/
1+
# Build results
52
[Bb]in/
3+
[Oo]bj/
4+
5+
# Visual Studio cache directory
6+
.vs/
67

7-
# Other files and folders
8-
.settings/
8+
nugets/
99

10-
# Executables
11-
*.swf
12-
*.air
13-
*.ipa
14-
*.apk
10+
# ReSharper is a .NET coding add-in
11+
*.DotSettings.user
1512

16-
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`
17-
# should NOT be excluded as they contain compiler settings and other important
18-
# information for Eclipse / Flash Builder.
13+
# Approval Tests
14+
*.received.*

license.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Simon Cropp
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

readme.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
<!--
2+
GENERATED FILE - DO NOT EDIT
3+
This file was generated by [MarkdownSnippets](https://github.com/SimonCropp/MarkdownSnippets).
4+
Source File: /readme.source.md
5+
To change this file edit the source file and then run MarkdownSnippets.
6+
-->
7+
8+
# <img src="/src/icon.png" height="30px"> Verify.Web
9+
10+
[![Build status](https://ci.appveyor.com/api/projects/status/7k8hh0guut2ioak2?svg=true)](https://ci.appveyor.com/project/SimonCropp/verify-web)
11+
[![NuGet Status](https://img.shields.io/nuget/v/Verify.Web.svg)](https://www.nuget.org/packages/Verify.Web/)
12+
13+
Extends [Verify](https://github.com/SimonCropp/Verify) to allow verification of web bits.
14+
15+
Converts documents (pdf, docx, xslx, and pptx) to png for verification.
16+
17+
18+
<!-- toc -->
19+
## Contents
20+
21+
* [Usage](#usage)
22+
* [Controller](#controller)<!-- endtoc -->
23+
24+
25+
## NuGet package
26+
27+
https://nuget.org/packages/Verify.Web/
28+
29+
30+
## Usage
31+
32+
Enable VerifyWeb once at assembly load time:
33+
34+
<!-- snippet: Enable -->
35+
<a id='snippet-enable'/></a>
36+
```cs
37+
VerifyWeb.Enable();
38+
```
39+
<sup><a href='/src/Tests/GlobalSetup.cs#L9-L11' title='File snippet `enable` was extracted from'>snippet source</a> | <a href='#snippet-enable' title='Navigate to start of snippet `enable`'>anchor</a></sup>
40+
<!-- endsnippet -->
41+
42+
43+
### Controller
44+
45+
Given the following controller:
46+
47+
<!-- snippet: MyController.cs -->
48+
<a id='snippet-MyController.cs'/></a>
49+
```cs
50+
using System.Collections.Generic;
51+
using Microsoft.AspNetCore.Mvc;
52+
53+
public class MyController :
54+
Controller
55+
{
56+
public ActionResult<List<DataItem>> Method(string input)
57+
{
58+
var headers = HttpContext.Response.Headers;
59+
headers.Add("headerKey", "headerValue");
60+
headers.Add("receivedInput", input);
61+
62+
var cookies = HttpContext.Response.Cookies;
63+
cookies.Append("cookieKey", "cookieValue");
64+
65+
var items = new List<DataItem>
66+
{
67+
new DataItem("Value1"),
68+
new DataItem("Value2")
69+
};
70+
return new ActionResult<List<DataItem>>(items);
71+
}
72+
73+
public class DataItem
74+
{
75+
public string Value { get; }
76+
77+
public DataItem(string value)
78+
{
79+
Value = value;
80+
}
81+
}
82+
}
83+
```
84+
<sup><a href='/src/Tests/Snippets/MyController.cs#L1-L33' title='File snippet `MyController.cs` was extracted from'>snippet source</a> | <a href='#snippet-MyController.cs' title='Navigate to start of snippet `MyController.cs`'>anchor</a></sup>
85+
<!-- endsnippet -->
86+
87+
This test:
88+
89+
<!-- snippet: MyControllerTests.cs -->
90+
<a id='snippet-MyControllerTests.cs'/></a>
91+
```cs
92+
using System.Threading.Tasks;
93+
using Microsoft.AspNetCore.Http;
94+
using Microsoft.AspNetCore.Mvc;
95+
using VerifyXunit;
96+
using Xunit;
97+
using Xunit.Abstractions;
98+
99+
public class MyControllerTests :
100+
VerifyBase
101+
{
102+
public MyControllerTests(ITestOutputHelper output) :
103+
base(output)
104+
{
105+
}
106+
107+
[Fact]
108+
public Task Test()
109+
{
110+
var context = new ControllerContext
111+
{
112+
HttpContext = new DefaultHttpContext()
113+
};
114+
var controller = new MyController
115+
{
116+
ControllerContext = context
117+
};
118+
119+
var result = controller.Method("inputValue");
120+
return Verify(
121+
new
122+
{
123+
result,
124+
context
125+
});
126+
}
127+
}
128+
```
129+
<sup><a href='/src/Tests/Snippets/MyControllerTests.cs#L1-L36' title='File snippet `MyControllerTests.cs` was extracted from'>snippet source</a> | <a href='#snippet-MyControllerTests.cs' title='Navigate to start of snippet `MyControllerTests.cs`'>anchor</a></sup>
130+
<!-- endsnippet -->
131+
132+
Will result in the following verified file:
133+
134+
<!-- snippet: MyControllerTests.Test.verified.txt -->
135+
<a id='snippet-MyControllerTests.Test.verified.txt'/></a>
136+
```txt
137+
138+
```
139+
<sup><a href='/src/Tests/Snippets/MyControllerTests.Test.verified.txt#L1-L1' title='File snippet `MyControllerTests.Test.verified.txt` was extracted from'>snippet source</a> | <a href='#snippet-MyControllerTests.Test.verified.txt' title='Navigate to start of snippet `MyControllerTests.Test.verified.txt`'>anchor</a></sup>
140+
<!-- endsnippet -->
141+
142+
143+
## Icon
144+
145+
[Swirl](https://thenounproject.com/term/swirl/1568686/) designed by [creativepriyanka](https://thenounproject.com/creativepriyanka) from [The Noun Project](https://thenounproject.com/creativepriyanka).

readme.source.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# <img src="/src/icon.png" height="30px"> Verify.Web
2+
3+
[![Build status](https://ci.appveyor.com/api/projects/status/7k8hh0guut2ioak2?svg=true)](https://ci.appveyor.com/project/SimonCropp/verify-web)
4+
[![NuGet Status](https://img.shields.io/nuget/v/Verify.Web.svg)](https://www.nuget.org/packages/Verify.Web/)
5+
6+
Extends [Verify](https://github.com/SimonCropp/Verify) to allow verification of web bits.
7+
8+
Converts documents (pdf, docx, xslx, and pptx) to png for verification.
9+
10+
11+
toc
12+
13+
14+
## NuGet package
15+
16+
https://nuget.org/packages/Verify.Web/
17+
18+
19+
## Usage
20+
21+
Enable VerifyWeb once at assembly load time:
22+
23+
snippet: Enable
24+
25+
26+
### Controller
27+
28+
Given the following controller:
29+
30+
snippet: MyController.cs
31+
32+
This test:
33+
34+
snippet: MyControllerTests.cs
35+
36+
Will result in the following verified file:
37+
38+
snippet: MyControllerTests.Test.verified.txt
39+
40+
41+
## Icon
42+
43+
[Swirl](https://thenounproject.com/term/swirl/1568686/) designed by [creativepriyanka](https://thenounproject.com/creativepriyanka) from [The Noun Project](https://thenounproject.com/creativepriyanka).

0 commit comments

Comments
 (0)