summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrandonmwest <brawest@gmail.com>2013-01-10 11:42:23 -0800
committerbrandonmwest <brawest@gmail.com>2013-01-10 11:42:23 -0800
commit971e416de388e58d34ea81032bcda060274d269a (patch)
tree6133a830e6308f32f26cd96ae5d2e323a1dc04aa
parent1e3816f93799c66c59ad89e01ee42c858ffda0a9 (diff)
parent2e51a34035a05ec7df8f05fca5a8787787a78bc6 (diff)
downloadsendgrid-csharp-971e416de388e58d34ea81032bcda060274d269a.zip
sendgrid-csharp-971e416de388e58d34ea81032bcda060274d269a.tar.gz
sendgrid-csharp-971e416de388e58d34ea81032bcda060274d269a.tar.bz2
Merge pull request #17 from brandonmwest/master
Changed codescales to embedded resource
-rwxr-xr-x.gitignore1
-rw-r--r--[-rwxr-xr-x]SendGrid/SendGridMail/Mail.csproj21
-rwxr-xr-xSendGrid/SendGridMail/StreamedFileBody.cs3
-rwxr-xr-xSendGrid/Tests/TestSendgridMessageSetup.cs1
-rwxr-xr-xSendGrid/Tests/Transport/TestSMTP.cs6
5 files changed, 15 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore
index 8307c0b..d15e142 100755
--- a/.gitignore
+++ b/.gitignore
@@ -14,3 +14,4 @@ SendGrid/*/obj/
SendGrid/Tests/test-results/
SendGrid/test-results/
.DS_store
+SendGrid/SendGrid.userprefs \ No newline at end of file
diff --git a/SendGrid/SendGridMail/Mail.csproj b/SendGrid/SendGridMail/Mail.csproj
index 91d3b91..b85ec5e 100755..100644
--- a/SendGrid/SendGridMail/Mail.csproj
+++ b/SendGrid/SendGridMail/Mail.csproj
@@ -10,13 +10,12 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SendGridMail</RootNamespace>
<AssemblyName>SendGridMail</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
+ <DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
- <Optimize>false</Optimize>
+ <Optimize>False</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
@@ -24,17 +23,13 @@
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
+ <Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="CodeScales.Http, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>lib\CodeScales.Http.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net" />
@@ -46,6 +41,10 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
+ <Reference Include="CodeScales.Http">
+ <HintPath>lib\CodeScales.Http.dll</HintPath>
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Header.cs" />
@@ -59,9 +58,6 @@
<Compile Include="Transport\SMTP.cs" />
<Compile Include="Utils.cs" />
</ItemGroup>
- <ItemGroup>
- <Content Include="lib\CodeScales.Http.dll" />
- </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
@@ -70,4 +66,7 @@
<Target Name="AfterBuild">
</Target>
-->
+ <ItemGroup>
+ <EmbeddedResource Include="lib\CodeScales.Http.dll" />
+ </ItemGroup>
</Project> \ No newline at end of file
diff --git a/SendGrid/SendGridMail/StreamedFileBody.cs b/SendGrid/SendGridMail/StreamedFileBody.cs
index 6bb5ec1..50d218c 100755
--- a/SendGrid/SendGridMail/StreamedFileBody.cs
+++ b/SendGrid/SendGridMail/StreamedFileBody.cs
@@ -31,8 +31,7 @@ namespace SendGridMail
string paramBoundry = "--" + boundry + "\r\n";
string stringParam = "Content-Disposition: form-data; name=\"" + _name + "\"; filename=\"" + _filename + "\"\r\n";
string paramEnd = "Content-Type: image/png\r\n\r\n";
- string foo = paramBoundry + stringParam + paramEnd;
-
+
bytes.AddRange(Encoding.ASCII.GetBytes(paramBoundry + stringParam + paramEnd));
bytes.AddRange(_content);
bytes.AddRange(Encoding.ASCII.GetBytes("\r\n"));
diff --git a/SendGrid/Tests/TestSendgridMessageSetup.cs b/SendGrid/Tests/TestSendgridMessageSetup.cs
index ea57eb7..5719d04 100755
--- a/SendGrid/Tests/TestSendgridMessageSetup.cs
+++ b/SendGrid/Tests/TestSendgridMessageSetup.cs
@@ -172,7 +172,6 @@ namespace Tests
var foo = new Mock<IHeader>();
var sg = new SendGrid(foo.Object);
- var data = new Attachment("pnunit.framework.dll", MediaTypeNames.Application.Octet);
sg.AddAttachment("pnunit.framework.dll");
sg.AddAttachment("pnunit.framework.dll");
//Assert.AreEqual(data.ContentStream, sg.Attachments.First().ContentStream, "Attach via path");
diff --git a/SendGrid/Tests/Transport/TestSMTP.cs b/SendGrid/Tests/Transport/TestSMTP.cs
index 3c17008..24c1a47 100755
--- a/SendGrid/Tests/Transport/TestSMTP.cs
+++ b/SendGrid/Tests/Transport/TestSMTP.cs
@@ -38,14 +38,14 @@ namespace Tests.Transport
mock.SetupProperty(foo => foo.EnableSsl);
var client = mock.Object;
var credentials = new NetworkCredential("username", "password");
- var test = SMTP.GetInstance(client, credentials);
+ SMTP.GetInstance(client, credentials);
mock.Verify(foo => foo.EnableSsl, Times.Never());
mock = new Mock<SMTP.ISmtpClient>();
mock.SetupProperty(foo => foo.EnableSsl);
client = mock.Object;
credentials = new NetworkCredential("username", "password");
- test = SMTP.GetInstance(client, credentials, port:SMTP.SslPort);
+ SMTP.GetInstance(client, credentials, port:SMTP.SslPort);
mock.VerifySet(foo => foo.EnableSsl = true);
mock = new Mock<SMTP.ISmtpClient>();
@@ -54,7 +54,7 @@ namespace Tests.Transport
credentials = new NetworkCredential("username", "password");
try
{
- test = SMTP.GetInstance(client, credentials, port: SMTP.TlsPort);
+ SMTP.GetInstance(client, credentials, port: SMTP.TlsPort);
Assert.Fail("should have thrown an unsupported port exception");
}
catch (NotSupportedException ex)