Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
75fcbcf
Remove ValuesController which is generated by the wizard
letsdoit-today Mar 27, 2016
209b031
renamed sql files
letsdoit-today Mar 27, 2016
4fa5a56
Implemented get()
letsdoit-today Mar 27, 2016
8ccf0e2
Added table City to the database
letsdoit-today Mar 27, 2016
f47229c
Added the test
letsdoit-today Mar 29, 2016
a6986be
add new column to table City
letsdoit-today Mar 29, 2016
283abbd
Test
letsdoit-today Apr 6, 2016
9e4c6f7
Remove the new added colume
letsdoit-today Apr 6, 2016
1e42401
Add a new colume "Region" to table City
letsdoit-today Apr 6, 2016
d71642e
Reset db part
letsdoit-today Apr 7, 2016
3f3667a
Add column "Region" to table "City"
letsdoit-today Apr 7, 2016
0de7245
change db update strategy from rebuild to upgrade.
letsdoit-today Apr 8, 2016
bb75314
dds
letsdoit-today Apr 8, 2016
866aadd
add a new column to table city
letsdoit-today Apr 8, 2016
4a5a0e2
break the tests
letsdoit-today Apr 10, 2016
74e4b5f
break the build
letsdoit-today Apr 10, 2016
014c005
fixed test issue
letsdoit-today Apr 10, 2016
f7b575b
11
letsdoit-today Apr 10, 2016
e189f63
dfs
letsdoit-today Apr 10, 2016
bfc1965
break the build
letsdoit-today Apr 10, 2016
d6779bd
fix the test issue
letsdoit-today Apr 10, 2016
bce07e2
break the build
letsdoit-today Apr 10, 2016
90b8e4c
fix test
letsdoit-today Apr 29, 2016
8a5f1f7
11
letsdoit-today Apr 29, 2016
50c201d
sfdsdf
letsdoit-today Apr 30, 2016
c5aaa56
desdf
letsdoit-today Apr 30, 2016
bfb7e14
use nant to do the build
letsdoit-today Apr 30, 2016
12654a0
111
letsdoit-today Apr 30, 2016
ea8661f
fixed issues
letsdoit-today Apr 30, 2016
3f0b4dc
111
letsdoit-today Apr 30, 2016
3f090f1
123
letsdoit-today Apr 30, 2016
4d4d665
1111
letsdoit-today Apr 30, 2016
6da00ee
xcvx
letsdoit-today Apr 30, 2016
c426c8c
12323
letsdoit-today Apr 30, 2016
99ca194
123
letsdoit-today Apr 30, 2016
1a8c383
33
letsdoit-today Apr 30, 2016
d466b62
User DotCover for coverage report
letsdoit-today Apr 30, 2016
0c4cbf1
Use DotCover
letsdoit-today Apr 30, 2016
f3a24a7
Use DotCover to generated coverage report
letsdoit-today Apr 30, 2016
8a164ca
all set
letsdoit-today May 1, 2016
a88b4dd
delete unused files
letsdoit-today May 1, 2016
3f4a7aa
fix issues
letsdoit-today May 1, 2016
6874e48
revert the change
letsdoit-today May 1, 2016
bb36679
add dotcover.xml
letsdoit-today May 1, 2016
a871581
update dotcover
letsdoit-today May 1, 2016
e6465a4
add a new test
letsdoit-today May 1, 2016
020a41d
alter table CITY
letsdoit-today May 1, 2016
331af9d
break the build
letsdoit-today May 2, 2016
0be2faa
fix the test issue
letsdoit-today May 2, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<project name="Tutorial Demo" default="build" basedir=".">
<description>The Demo project for Tutorial</description>
<property name="debug" value="true" overwrite="false" />

<property name="output.dir" value=".\output" />

<property name="mstest.exe" value="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe" />

<property name="dotcover.exe" value="D:\TeamCity\buildAgent\tools\dotCover\dotcover.exe" />

<property name="msbuild.exe" value="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe" />

<property name="nuget.exe" value="D:\tools\nuget.exe" />

<target name="init" depends="clean">
<mkdir dir="${output.dir}" />
</target>

<target name="clean" description="remove all generated files">
<delete dir="${output.dir}" />
</target>

<target name="nuget" >
<exec program="${nuget.exe}" verbose="true" failonerror="true">
<arg line="restore" />
<arg line="." />
</exec>
</target>

<target name="build" description="compiles the source code" depends="init,nuget">
<exec program="${msbuild.exe}" verbose="true" failonerror="true">
<arg line="/m" />
<arg line="/t:build" />
<arg line="/p:Configuration=Release" />
<arg line="/p:VisualStudioVersion=14.0" />
<arg line="tutorial.sln" />
</exec>
</target>

<target name="coverage" description="Use JebBrain's DotCover to generate coverage report">
<!-- Run tests and generated dotcover snapshots -->
<exec program="${dotcover.exe}" verbose="true" failonerror="true">
<arg line="analyse" />
<arg line="dotcover.xml" />
</exec>
</target>
</project>
37 changes: 37 additions & 0 deletions dotcover.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<AnalyseParams>
<TargetExecutable>C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\MSTest.exe</TargetExecutable>
<TargetArguments>/testcontainer:tutorial\bin\tutorial.dll</TargetArguments>
<TargetWorkingDir>.</TargetWorkingDir>
<Output>output/coverage.html</Output>
<ReportType>HTML</ReportType>

<!-- Allows including not loaded assemblies in the specified scope into coverage results. Ant-style patterns are supported here.
<Scope>
<ScopeEntry>ProjectFolder/**/*.dll</ScopeEntry>
<ScopeEntry>ProjectFolder/**/*.exe</ScopeEntry>
</Scope>
-->
<Filters>
<IncludeFilters>
<FilterEntry>
<ModuleMask>tutorial</ModuleMask>
<ClassMask>*</ClassMask>
<FunctionMask>*</FunctionMask>
</FilterEntry>
</IncludeFilters>
</Filters>
<!-- Coverage filters. It's possible to use asterisks as wildcard symbols.
<ExcludeFilters>
<FilterEntry>...</FilterEntry>
<FilterEntry>...</FilterEntry>
<FilterEntry>...</FilterEntry>
</ExcludeFilters>
-->
<!-- Attribute filters. It's possible to use asterisks as wildcard symbols.
<AttributeFilters>
<AttributeFilterEntry> Attribute class mask </AttributeFilterEntry>
<AttributeFilterEntry>System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute</AttributeFilterEntry>
</AttributeFilters>
-->
</AnalyseParams>
14 changes: 14 additions & 0 deletions tutorial.Tests/Controllers/ProductControllerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,19 @@ public void GetAll()
Assert.IsNotNull(result);
Assert.AreEqual(77, result.Count());
}

[TestMethod]
public void GetById()
{
// Arrange
ProductController controller = new ProductController();

// Act
Product product = controller.Get(5);

// Assert
Assert.IsNotNull(product);
Assert.AreEqual("Chef Anton's Gumbo Mix", product.ProductName);
}
}
}
81 changes: 0 additions & 81 deletions tutorial.Tests/Controllers/ValuesControllerTest.cs

This file was deleted.

1 change: 0 additions & 1 deletion tutorial.Tests/tutorial.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
<Compile Include="Controllers\ProductControllerTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Controllers\HomeControllerTest.cs" />
<Compile Include="Controllers\ValuesControllerTest.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="App.config" />
Expand Down
8 changes: 7 additions & 1 deletion tutorial.sln
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tutorial", "tutorial\tutorial.csproj", "{87B8D7E9-2398-4BE5-A432-850D7E7DAF88}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "tutorial.Tests", "tutorial.Tests\tutorial.Tests.csproj", "{7E2FEAA7-E20B-4A5B-929B-A925354E31B5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9462607A-9608-474F-A5D0-D9BD7FDCC66A}"
ProjectSection(SolutionItems) = preProject
build.xml = build.xml
dotcover.xml = dotcover.xml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
4 changes: 2 additions & 2 deletions tutorial/Controllers/ProductController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public IQueryable<Product> Get()
}

// GET api/<controller>/5
public string Get(int id)
public Product Get(int id)
{
return "value";
return db.Products.Find(id);
}

// POST api/<controller>
Expand Down
39 changes: 0 additions & 39 deletions tutorial/Controllers/ValuesController.cs

This file was deleted.

25 changes: 25 additions & 0 deletions tutorial/Controllers/tests/HomeControllerTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Web.Mvc;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using tutorial;
using tutorial.Controllers;

namespace tutorial.Tests.Controllers
{
[TestClass]
public class HomeControllerTest
{
[TestMethod]
public void Index()
{
// Arrange
HomeController controller = new HomeController();

// Act
ViewResult result = controller.Index() as ViewResult;

// Assert
Assert.IsNotNull(result);
Assert.AreEqual("Home Page", result.ViewBag.Title);
}
}
}
43 changes: 43 additions & 0 deletions tutorial/Controllers/tests/ProductControllerTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

using tutorial.Controllers;
using System.Collections.Generic;
using System.Linq;

namespace tutorial.Tests.Controllers
{
[TestClass]
public class ProductControllerTest
{
[TestMethod]
public void GetAll()
{
// Arrange
ProductController controller = new ProductController();

// Act
IQueryable<Product> result = controller.Get();

// Assert
Assert.IsNotNull(result);
Assert.AreEqual(77, result.Count());
}


[TestMethod]
public void GetById()
{
// Arrange
ProductController controller = new ProductController();

// Act
Product product = controller.Get(5);

// Assert
Assert.IsNotNull(product);
Assert.AreEqual("Chef Anton's Gumbo Mix", product.ProductName);
}

}
}
26 changes: 26 additions & 0 deletions tutorial/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions tutorial/Properties/Settings.settings
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
</SettingsFile>
3 changes: 3 additions & 0 deletions tutorial/Web.Release.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<connectionStrings>
<add name="NorthwindEntities" connectionString="metadata=res://*/Northwind.csdl|res://*/Northwind.ssdl|res://*/Northwind.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=TUTORIAL\TUTORIAL;initial catalog=Northwind;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
Expand Down
1 change: 0 additions & 1 deletion tutorial/db/buildDB.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ SET DIR=%~d0%~p0%
SET connstring="data source=TUTORIAL\TUTORIAL;initial catalog=Northwind;integrated security=True"
SET repository.path="https://github.com/espiderinc/tutorial-demo-net.git"

"%DIR%..\..\packages\roundhouse.0.8.6\bin\rh.exe" /c=%connstring% /vf=../bin/tutorial.dll /r=%repository.path% /env=LOCAL /ni /drop
"%DIR%..\..\packages\roundhouse.0.8.6\bin\rh.exe" /c=%connstring% /vf=../bin/tutorial.dll /r=%repository.path% /env=LOCAL /ni /simple
File renamed without changes.
7 changes: 7 additions & 0 deletions tutorial/db/up/002CreateTableCity.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE City (
"CityID" INT NOT NULL,
"CityName" NCHAR (50) NOT NULL,
"CityDescription" NCHAR (50) NOT NULL,
"Country" NCHAR (50) Not NULL,
CONSTRAINT "PK_City" PRIMARY KEY NONCLUSTERED ("CityID" ASC)
);
Loading