diff options
32 files changed, 1443 insertions, 22 deletions
diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 16e54e2..0000000 --- a/.gitignore +++ /dev/null @@ -1,22 +0,0 @@ -/.web-server-pid -/app/config/parameters.yml -/build/ -/phpunit.xml -/var/* -!/var/cache -/var/cache/* -!var/cache/.gitkeep -!/var/logs -/var/logs/* -!var/logs/.gitkeep -!/var/sessions -/var/sessions/* -!var/sessions/.gitkeep -!var/SymfonyRequirements.php -/vendor/ -/web/bundles/ -<<<<<<< HEAD -.idea -======= -/.idea/ ->>>>>>> 72114be2d32b090f68996acb87cef7fde748b534 diff --git a/PollutometerWebApi.Tests/AqiCalculatorTests.cs b/PollutometerWebApi.Tests/AqiCalculatorTests.cs new file mode 100644 index 0000000..e84b687 --- /dev/null +++ b/PollutometerWebApi.Tests/AqiCalculatorTests.cs @@ -0,0 +1,51 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using PollutometerWebApi.Models; + +namespace PollutometerWebApi.Tests +{ + [TestClass()] + public class AqiCalculatorTests + { + [TestMethod()] + public void CalculateAqiPerfectTest() + { + var reading = new Reading + { + Co = 2.2, + No = 0.1, + So = 0.8 + }; + + var result = AqiCalculator.CalculateAqi(reading); + Assert.AreEqual(398.0100502512563, result.Value); + } + + [TestMethod()] + public void CalculateAqiBigNumbersTest() + { + var reading = new Reading + { + Co = 100.2, + No = 100.1, + So = 100.8 + }; + + var result = AqiCalculator.CalculateAqi(reading); + Assert.AreEqual(0, result.Value); + } + + [TestMethod()] + public void CalculateAqiZerosTest() + { + var reading = new Reading + { + Co = 0, + No = 0, + So = 0 + }; + + var result = AqiCalculator.CalculateAqi(reading); + Assert.AreEqual(0, result.Value); + } + } +}
\ No newline at end of file diff --git a/PollutometerWebApi.Tests/EmailSenderTests.cs b/PollutometerWebApi.Tests/EmailSenderTests.cs new file mode 100644 index 0000000..427ec92 --- /dev/null +++ b/PollutometerWebApi.Tests/EmailSenderTests.cs @@ -0,0 +1,21 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using PollutometerWebApi.Models; + +namespace PollutometerWebApi.Tests +{ + [TestClass()] + public class EmailSenderTests + { + [TestMethod()] + public void SendEmailTest() + { + var aqi = new Aqi + { + GasName = "SO", + Value = 69, + Level = "Moderate" + }; + EmailSender.SendEmail(aqi); + } + } +}
\ No newline at end of file diff --git a/PollutometerWebApi.Tests/PollutometerWebApi.Tests.csproj b/PollutometerWebApi.Tests/PollutometerWebApi.Tests.csproj new file mode 100644 index 0000000..6ff37aa --- /dev/null +++ b/PollutometerWebApi.Tests/PollutometerWebApi.Tests.csproj @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{94A21C38-920E-42EF-8D48-B133D635EAFA}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>PollutometerWebApi.Tests</RootNamespace>
+ <AssemblyName>PollutometerWebApi.Tests</AssemblyName>
+ <TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
+ <IsCodedUITest>False</IsCodedUITest>
+ <TestProjectType>UnitTest</TestProjectType>
+ <TargetFrameworkProfile />
+ <NuGetPackageImportStamp>
+ </NuGetPackageImportStamp>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <HintPath>..\packages\MSTest.TestFramework.1.1.18\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
+ </Reference>
+ <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
+ <HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Net.Http.Formatting, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.0\lib\net45\System.Net.Http.Formatting.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Transactions" />
+ <Reference Include="System.Web.Http, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.0\lib\net45\System.Web.Http.dll</HintPath>
+ </Reference>
+ <Reference Include="System.Web.Http.WebHost, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.0\lib\net45\System.Web.Http.WebHost.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <Choose>
+ <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
+ <ItemGroup>
+ <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+ </ItemGroup>
+ </When>
+ <Otherwise />
+ </Choose>
+ <ItemGroup>
+ <Compile Include="AqiCalculatorTests.cs" />
+ <Compile Include="EmailSenderTests.cs" />
+ <Compile Include="ReadingsControllerTests.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="SqlOperatorTests.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="app.config" />
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\PollutometerWebApi\PollutometerWebApi.csproj">
+ <Project>{22C32F4C-0DEB-40EA-9D56-48942CBB2A07}</Project>
+ <Name>PollutometerWebApi</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Choose>
+ <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
+ <ItemGroup>
+ <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <Private>False</Private>
+ </Reference>
+ <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
+ <Private>False</Private>
+ </Reference>
+ </ItemGroup>
+ </When>
+ </Choose>
+ <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.props'))" />
+ <Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets'))" />
+ </Target>
+ <Import Project="..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.1.18\build\net45\MSTest.TestAdapter.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.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file diff --git a/PollutometerWebApi.Tests/Properties/AssemblyInfo.cs b/PollutometerWebApi.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d6c3cc7 --- /dev/null +++ b/PollutometerWebApi.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("PollutometerWebApi.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("PollutometerWebApi.Tests")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("94a21c38-920e-42ef-8d48-b133d635eafa")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PollutometerWebApi.Tests/ReadingsControllerTests.cs b/PollutometerWebApi.Tests/ReadingsControllerTests.cs new file mode 100644 index 0000000..647649d --- /dev/null +++ b/PollutometerWebApi.Tests/ReadingsControllerTests.cs @@ -0,0 +1,116 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using PollutometerWebApi.Models; +using System; +using System.Collections.Generic; +using System.Web.Http.Results; + +namespace PollutometerWebApi.Controllers.Tests +{ + [TestClass()] + public class ReadingsControllerTests + { + ReadingsController controller = new ReadingsController(); + + [TestMethod()] + public void GetAllReadingsTest() + { + var actionResult = controller.GetAllReadings(); + var content = ((OkNegotiatedContentResult<List<Reading>>)actionResult).Content; + Assert.IsTrue(content.Count >= 1); + } + + + [TestMethod()] + public void GetReadingTest() + { + var actionResult = controller.GetReading(0); + Assert.IsInstanceOfType(actionResult, typeof(OkNegotiatedContentResult<Reading>)); + } + + [TestMethod()] + public void GetLatestReadingTest() + { + var actionResult = controller.GetLatestReading(); + var content = ((OkNegotiatedContentResult<Reading>)actionResult).Content; + Assert.IsNotNull(content); + } + + [TestMethod()] + public void GetReadingsFromLastWeekTest() + { + var actionResult = controller.GetReadingsFromLastWeek(); + var content = ((OkNegotiatedContentResult<List<Reading>>)actionResult).Content; + foreach(var reading in content) + { + var now = DateTimeOffset.Now.ToUnixTimeSeconds(); + Assert.IsTrue(reading.TimeStamp < now && reading.TimeStamp > now - 7*24*3600); + } + } + + [TestMethod()] + public void PostReadingPassTest() + { + var newReading = new Reading + { + TimeStamp = (int)DateTimeOffset.Now.ToUnixTimeSeconds(), + Co = 1.0, + No = 1.0, + So = 1.0 + }; + var actionResult = controller.PostReading(newReading); + var reading = controller.GetLatestReading(); + var content = ((OkNegotiatedContentResult<Reading>)reading).Content; + Assert.AreEqual(newReading.TimeStamp, content.TimeStamp); + } + + [TestMethod()] + public void PostReadingFailTest() + { + var actionResult = controller.PostReading(null); + Assert.IsInstanceOfType(actionResult, typeof(BadRequestResult)); + } + + [TestMethod()] + public void PutReadingPassTest() + { + var latest = controller.GetLatestReading(); + var content = ((OkNegotiatedContentResult<Reading>)latest).Content; + var actionResult = controller.PutReading(content.Id, + new Reading + { + TimeStamp = (int)DateTimeOffset.Now.ToUnixTimeSeconds(), + Co = 2.0, + No = 2.0, + So = 2.0 + } + ); + Assert.AreEqual(typeof(OkResult), actionResult.GetType()); + } + + [TestMethod()] + public void PutReadingFailTest() + { + var latest = controller.GetLatestReading(); + var content = ((OkNegotiatedContentResult<Reading>)latest).Content; + var actionResult = controller.PutReading(content.Id, null); + Assert.AreEqual(typeof(BadRequestResult), actionResult.GetType()); + } + + [TestMethod()] + public void DeleteReadingPassTest() + { + var latest = controller.GetLatestReading(); + var content = ((OkNegotiatedContentResult<Reading>)latest).Content; + var actionResult = controller.DeleteReading(content.Id); + var reading = controller.GetReading(content.Id); + Assert.IsInstanceOfType(reading, typeof(NotFoundResult)); + } + + [TestMethod()] + public void DeleteReadingFailTest() + { + var actionResult = controller.DeleteReading(1337); + Assert.IsInstanceOfType(actionResult, typeof(NotFoundResult)); + } + } +}
\ No newline at end of file diff --git a/PollutometerWebApi.Tests/SqlOperatorTests.cs b/PollutometerWebApi.Tests/SqlOperatorTests.cs new file mode 100644 index 0000000..2930679 --- /dev/null +++ b/PollutometerWebApi.Tests/SqlOperatorTests.cs @@ -0,0 +1,68 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using PollutometerWebApi.Models; +using System; + +namespace PollutometerWebApi.Tests +{ + [TestClass()] + public class SqlOperatorTests + { + [TestMethod()] + public void GetReadingsTest() + { + var readings = SqlOperator.GetReadings("SELECT * FROM Readings"); + Assert.IsTrue(readings.Count >= 1); + } + + [TestMethod()] + public void PostReadingTest() + { + var newReading = new Reading + { + TimeStamp = (int)DateTimeOffset.Now.ToUnixTimeSeconds(), + Co = 0.0, + No = 0.0, + So = 0.0 + }; + SqlOperator.PostReading(newReading); + var command = "SELECT * FROM Readings " + + "WHERE TimeStamp IN(SELECT MAX(TimeStamp) FROM Readings)"; + var latestReading = SqlOperator.GetReadings(command)[0]; + var command2 = $"SELECT * FROM Readings WHERE Id={latestReading.Id}"; + var reading = SqlOperator.GetReadings(command2)[0]; + Assert.AreEqual(newReading.TimeStamp, reading.TimeStamp); + } + + [TestMethod()] + public void PutReadingTest() + { + var newReading = new Reading + { + TimeStamp = (int)DateTimeOffset.Now.ToUnixTimeSeconds(), + Co = 0.5, + No = 0.5, + So = 0.5 + + }; + var command = "SELECT * FROM Readings " + + "WHERE TimeStamp IN(SELECT MAX(TimeStamp) FROM Readings)"; + var latestReading = SqlOperator.GetReadings(command)[0]; + SqlOperator.PutReading(latestReading.Id, newReading); + var command2 = $"SELECT * FROM Readings WHERE Id={latestReading.Id}"; + var reading = SqlOperator.GetReadings(command2)[0]; + Assert.AreEqual(newReading.TimeStamp, reading.TimeStamp); + } + + [TestMethod()] + public void DeleteReadingTest() + { + var command = "SELECT * FROM Readings " + + "WHERE TimeStamp IN(SELECT MAX(TimeStamp) FROM Readings)"; + var latestReading = SqlOperator.GetReadings(command)[0]; + SqlOperator.DeleteReading(latestReading.Id); + var command2 = $"SELECT * FROM Readings WHERE Id={latestReading.Id}"; + var readings = SqlOperator.GetReadings(command2); + Assert.IsTrue(readings.Count == 0); + } + } +}
\ No newline at end of file diff --git a/PollutometerWebApi.Tests/app.config b/PollutometerWebApi.Tests/app.config new file mode 100644 index 0000000..4429813 --- /dev/null +++ b/PollutometerWebApi.Tests/app.config @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="utf-8"?> +<configuration> + <runtime> + <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> + <dependentAssembly> + <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> + <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> + </dependentAssembly> + </assemblyBinding> + </runtime> +</configuration>
\ No newline at end of file diff --git a/PollutometerWebApi.Tests/packages.config b/PollutometerWebApi.Tests/packages.config new file mode 100644 index 0000000..7472064 --- /dev/null +++ b/PollutometerWebApi.Tests/packages.config @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="Microsoft.AspNet.WebApi" version="5.2.0" targetFramework="net462" /> + <package id="Microsoft.AspNet.WebApi.Client" version="5.2.0" targetFramework="net462" /> + <package id="Microsoft.AspNet.WebApi.Core" version="5.2.0" targetFramework="net462" /> + <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.0" targetFramework="net462" /> + <package id="MSTest.TestAdapter" version="1.1.18" targetFramework="net462" /> + <package id="MSTest.TestFramework" version="1.1.18" targetFramework="net462" /> + <package id="Newtonsoft.Json" version="6.0.4" targetFramework="net462" /> +</packages>
\ No newline at end of file diff --git a/PollutometerWebApi.sln b/PollutometerWebApi.sln new file mode 100644 index 0000000..b4180e0 --- /dev/null +++ b/PollutometerWebApi.sln @@ -0,0 +1,30 @@ +Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.27004.2009
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PollutometerWebApi", "PollutometerWebApi\PollutometerWebApi.csproj", "{22C32F4C-0DEB-40EA-9D56-48942CBB2A07}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PollutometerWebApi.Tests", "PollutometerWebApi.Tests\PollutometerWebApi.Tests.csproj", "{94A21C38-920E-42EF-8D48-B133D635EAFA}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {22C32F4C-0DEB-40EA-9D56-48942CBB2A07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {22C32F4C-0DEB-40EA-9D56-48942CBB2A07}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {22C32F4C-0DEB-40EA-9D56-48942CBB2A07}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {22C32F4C-0DEB-40EA-9D56-48942CBB2A07}.Release|Any CPU.Build.0 = Release|Any CPU
+ {94A21C38-920E-42EF-8D48-B133D635EAFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {94A21C38-920E-42EF-8D48-B133D635EAFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {94A21C38-920E-42EF-8D48-B133D635EAFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {94A21C38-920E-42EF-8D48-B133D635EAFA}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {0EB49A9B-6175-4CB9-8202-5918BA7D2525}
+ EndGlobalSection
+EndGlobal
diff --git a/PollutometerWebApi.userprefs b/PollutometerWebApi.userprefs new file mode 100644 index 0000000..822fb73 --- /dev/null +++ b/PollutometerWebApi.userprefs @@ -0,0 +1,21 @@ +<Properties StartupConfiguration="{D19CA1E0-796F-480A-996D-3DFABFC6203F}|Unit Tests"> + <MonoDevelop.Ide.Workbench ActiveDocument="PollutometerWebApi/Models/Aqi.cs"> + <Files> + <File FileName="PollutometerWebApi/AqiCalculator.cs" Line="7" Column="16" /> + <File FileName="PollutometerWebApi.Tests/Test.cs" Line="16" Column="1" /> + <File FileName="PollutometerWebApi/Controllers/ReadingsController.cs" Line="71" Column="48" /> + <File FileName="PollutometerWebApi/EmailSender.cs" Line="25" Column="23" /> + <File FileName="PollutometerWebApi/Models/Aqi.cs" Line="10" Column="14" /> + </Files> + </MonoDevelop.Ide.Workbench> + <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" /> + <MonoDevelop.Ide.ItemProperties.PollutometerWebApi PreferredExecutionTarget="MonoDevelop.Default" /> + <MonoDevelop.Ide.DebuggingService.Breakpoints> + <BreakpointStore> + <Breakpoint file="/home/marcin/MonoDevelop Projects/Pollutometer-WebAPI/PollutometerWebApi/EmailSender.cs" relfile="PollutometerWebApi/EmailSender.cs" line="31" column="13" /> + </BreakpointStore> + </MonoDevelop.Ide.DebuggingService.Breakpoints> + <MonoDevelop.Ide.ItemProperties.PollutometerWebApi.Tests PreferredExecutionTarget="MonoDevelop.Default" /> + <MonoDevelop.Ide.DebuggingService.PinnedWatches /> + <MultiItemStartupConfigurations /> +</Properties>
\ No newline at end of file diff --git a/PollutometerWebApi/.gitignore b/PollutometerWebApi/.gitignore new file mode 100644 index 0000000..940794e --- /dev/null +++ b/PollutometerWebApi/.gitignore @@ -0,0 +1,288 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + < |