Skip to content

Commit e167a7f

Browse files
author
Matt Bernier
authored
Merge branch 'master' into master
2 parents 1a1e54d + eeff2b4 commit e167a7f

File tree

7 files changed

+139
-25
lines changed

7 files changed

+139
-25
lines changed

.github/PULL_REQUEST_TEMPLATE

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,24 @@
1-
<!--
2-
Please explain WHAT you changed and WHY.
1+
<!--
2+
We appreciate the effort for this pull request but before that please make sure you read the contribution guidelines given above, then fill out the blanks below.
33

4-
The title should be descriptive, for example:
54

6-
* *Fixed a typo in the apikeypermissions.md page*
7-
* *Added the maximum number of domain whitelabels you can create to domains.md*
8-
* *Fixing the number of days a batch id is valid in scheduling_parameters.md*
9-
10-
Fill out this form in the body:
11-
-->
12-
13-
**Description of the change**:
14-
**Reason for the change**:
15-
**Link to original source**:
16-
<!--
17-
If this pull request closes an issue, add in the issue number here
5+
Please enter each Issue number you are resolving in your PR after one of the following words [Fixes, Closes, Resolves]. This will auto-link these issues and close them when this PR is merged!
6+
e.g.
7+
Fixes #1
8+
Closes #2
189
-->
19-
Closes #
10+
# Fixes #
2011

2112
### Checklist
13+
- [ ] I have made a material change to the repo (functionality, testing, spelling, grammar)
14+
- [ ] I have read the [Contribution Guide] and my PR follows them.
15+
- [ ] I updated my branch with the master branch.
16+
- [ ] I have added tests that prove my fix is effective or that my feature works
17+
- [ ] I have added necessary documentation about the functionality in the appropriate .md file
18+
- [ ] I have added in line documentation to the code I modified
2219

23-
Make sure all of these items are complete, or else the PR will be ineligible for a code review.
20+
### Short description of what this PR does:
21+
-
22+
-
2423

25-
- [ ] Code passes all existing [tests](https://github.com/sendgrid/csharp-http-client/tree/master/UnitTest)
26-
- [ ] Any new functionality added includes new unit tests
27-
- [ ] Create or update example code to show the new functionality in action.
28-
- [ ] All code, branch, and git naming and style conventions are followed (see [`CONTRIBUTING.md`](https://github.com/sendgrid/csharp-http-client/blob/master/CONTRIBUTING.md#style-guidelines--naming-conventions))
29-
- [ ] Feature branch has been rebased off of the latest `master` branch. ( see [`CONTRIBUTING.md`](https://github.com/sendgrid/csharp-http-client/blob/master/CONTRIBUTING.md#creating-a-pull-request)).
24+
If you have questions, please send an email to [Sendgrid](mailto:dx@sendgrid.com), or file a Github Issue in this repository.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ CSharpHTTPClient/packages/
1414
CSharpHTTPClient/CSharpHTTPClient.sln.VisualState.xml
1515
*.PublicKey
1616
*.pfx
17+
18+
# Environment files
19+
.env/*.*

Example/.env_sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export SENDGRID_API_KEY=''

LICENSE.txt renamed to LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 SendGrid, Inc.
3+
Copyright (c) 2012-2017 SendGrid, Inc.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,20 @@ Console.WriteLine(response.StatusCode);
8585
Console.WriteLine(response.Body.ReadAsStringAsync().Result);
8686
Console.WriteLine(response.Headers.ToString());
8787
```
88-
8988
<a name="usage"></a>
9089
# Usage
9190

91+
- [Example Code](https://github.com/sendgrid/csharp-http-client/blob/master/Example/Example.cs)
92+
93+
## Environment Variables
94+
95+
You can do the following to create a .env file:
96+
97+
```cp .env_example .env```
98+
99+
Then, just add your API Key into your .env file.
100+
101+
92102
<a name="roadmap"></a>
93103
# Roadmap
94104

@@ -119,4 +129,4 @@ csharp-http-client is guided and supported by the SendGrid [Developer Experience
119129
csharp-http-client is maintained and funded by SendGrid, Inc. The names and logos for csharp-http-client are trademarks of SendGrid, Inc.
120130

121131
# License
122-
[The MIT License (MIT)](LICENSE.txt)
132+
[The MIT License (MIT)](LICENSE.txt)

UnitTest/RequiredFilesExistTest.cs

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
namespace SendGrid.Tests
2+
{
3+
4+
public class TestRequiredFilesExist {
5+
6+
// ./Docker or docker/Docker
7+
public void checkDockerExists() {
8+
boolean dockerExists = File.Exists("./Docker") ||
9+
File.Exists("./docker/Docker");
10+
Assert.True(dockerExists);
11+
}
12+
13+
// ./docker-compose.yml or ./docker/docker-compose.yml
14+
public void checkDockerComposeExists() {
15+
boolean dockerComposeExists = File.Exists("./docker-compose.yml") ||
16+
File.Exists("./docker/docker-compose.yml");
17+
Assert.True(dockerComposeExists);
18+
}
19+
20+
// ./.env_sample
21+
public void checkEnvSampleExists() {
22+
Assert.True(File.Exists("./.env_sample"));
23+
}
24+
25+
// ./.gitignore
26+
public void checkGitIgnoreExists() {
27+
Assert.True(File.Exists("./.gitignore"));
28+
}
29+
30+
// ./.travis.yml
31+
public void checkTravisExists() {
32+
Assert.True(File.Exists("./.travis.yml"));
33+
}
34+
35+
// ./.codeclimate.yml
36+
public void checkCodeClimateExists() {
37+
Assert.True(File.Exists("./.codeclimate.yml"));
38+
}
39+
40+
// ./CHANGELOG.md
41+
public void checkChangelogExists() {
42+
Assert.True(File.Exists("./CHANGELOG.md"));
43+
}
44+
45+
// ./CODE_OF_CONDUCT.md
46+
public void checkCodeOfConductExists() {
47+
Assert.True(File.Exists("./CODE_OF_CONDUCT.md"));
48+
}
49+
50+
// ./CONTRIBUTING.md
51+
public void checkContributingGuideExists() {
52+
Assert.True(File.Exists("./CONTRIBUTING.md"));
53+
}
54+
55+
// ./.github/ISSUE_TEMPLATE
56+
public void checkIssuesTemplateExists() {
57+
Assert.True(File.Exists("./.github/ISSUE_TEMPLATE"));
58+
}
59+
60+
// ./LICENSE.md
61+
public void checkLicenseExists() {
62+
Assert.True(File.Exists("./LICENSE.md"));
63+
}
64+
65+
// ./.github/PULL_REQUEST_TEMPLATE
66+
public void checkPullRequestExists() {
67+
Assert.True(File.Exists("./.github/PULL_REQUEST_TEMPLATE"));
68+
}
69+
70+
// ./README.md
71+
public void checkReadMeExists() {
72+
Assert.True(File.Exists("./README.md"));
73+
}
74+
75+
// ./TROUBLESHOOTING.md
76+
public void checkTroubleShootingGuideExists() {
77+
Assert.True(File.Exists("./TROUBLESHOOTING.md"));
78+
}
79+
80+
// ./USAGE.md
81+
public void checkUsageGuideExists() {
82+
Assert.True(File.Exists("./USAGE.md"));
83+
}
84+
85+
// ./USE_CASES.md
86+
public void checkUseCases() {
87+
Assert.True(File.Exists("./USE_CASES.md"));
88+
}
89+
}
90+
}

UnitTest/UnitTest.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
using System.Text;
88
using System.Net;
99
using System.Threading;
10+
using System.IO;
11+
using System.Linq;
1012

1113
namespace UnitTest
1214
{
@@ -95,4 +97,17 @@ public async void TestMethodCallWithCancellationToken()
9597
Response response = await test_client.get(cancellationToken: cancellationTokenSource.Token);
9698
}
9799
}
100+
101+
[TestFixture]
102+
public class TestRepositoryFiles
103+
{
104+
[Test]
105+
public void TestLicenseEndYear()
106+
{
107+
var licensePath = Path.Combine("..", "..", "..", "LICENSE.txt");
108+
string line = File.ReadLines(licensePath).Skip(2).Take(1).First();
109+
110+
Assert.AreEqual(DateTime.Now.Year.ToString(), line.Substring(19, 4));
111+
}
112+
}
98113
}

0 commit comments

Comments
 (0)