forked from SteveSanderson/GuestbookDemo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
unknown
authored and
unknown
committed
Mar 2, 2010
0 parents
commit 304ac02
Showing
35 changed files
with
1,374 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 11.00 | ||
# Visual Studio 2010 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Guestbook", "Guestbook\Guestbook.csproj", "{A3B0F7DA-544C-4E7F-967C-9F2D2EAD78D0}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Guestbook.Spec", "Guestbook.Spec\Guestbook.Spec.csproj", "{B3DC5763-BF6F-4547-807E-B5470F342C28}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Guestbook.Domain", "Guestbook.Domain\Guestbook.Domain.csproj", "{D7CDFBBF-7F13-44E1-8C56-D8884AFEDB5F}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{A3B0F7DA-544C-4E7F-967C-9F2D2EAD78D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{A3B0F7DA-544C-4E7F-967C-9F2D2EAD78D0}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{A3B0F7DA-544C-4E7F-967C-9F2D2EAD78D0}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{A3B0F7DA-544C-4E7F-967C-9F2D2EAD78D0}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{B3DC5763-BF6F-4547-807E-B5470F342C28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{B3DC5763-BF6F-4547-807E-B5470F342C28}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{B3DC5763-BF6F-4547-807E-B5470F342C28}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{B3DC5763-BF6F-4547-807E-B5470F342C28}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{D7CDFBBF-7F13-44E1-8C56-D8884AFEDB5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{D7CDFBBF-7F13-44E1-8C56-D8884AFEDB5F}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{D7CDFBBF-7F13-44E1-8C56-D8884AFEDB5F}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{D7CDFBBF-7F13-44E1-8C56-D8884AFEDB5F}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
|
||
namespace Guestbook.Domain.Entities | ||
{ | ||
public class GuestbookEntry | ||
{ | ||
public int GuestbookEntryId { get; set; } | ||
public string Author { get; set; } | ||
public DateTime PostedDate { get; set; } | ||
public string Comment { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>9.0.30729</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{D7CDFBBF-7F13-44E1-8C56-D8884AFEDB5F}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Guestbook.Domain</RootNamespace> | ||
<AssemblyName>Guestbook.Domain</AssemblyName> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<TargetFrameworkProfile /> | ||
</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="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Entities\GuestbookEntry.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="Repositories\GuestbookEntryRepository.cs" /> | ||
<Compile Include="Repositories\IGuestbookEntryRepository.cs" /> | ||
</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. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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("Guestbook.Domain")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Microsoft")] | ||
[assembly: AssemblyProduct("Guestbook.Domain")] | ||
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] | ||
[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("b0601292-7e38-4f87-aaca-3ee696d93f8c")] | ||
|
||
// 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")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Guestbook.Domain.Entities; | ||
|
||
namespace Guestbook.Domain.Repositories | ||
{ | ||
public class GuestbookEntryRepository : IGuestbookEntryRepository | ||
{ | ||
private readonly List<GuestbookEntry> _entries = new List<GuestbookEntry> { | ||
new GuestbookEntry { GuestbookEntryId = 1, Author = "Steve", PostedDate = DateTime.Now, Comment = "I like this" }, | ||
new GuestbookEntry { GuestbookEntryId = 2, Author = "Bert", PostedDate = DateTime.Now, Comment = "I don't like it" }, | ||
}; | ||
|
||
public IQueryable<GuestbookEntry> Entries { | ||
get { | ||
return _entries.AsQueryable(); | ||
} | ||
} | ||
|
||
public void AddEntry(GuestbookEntry entry) | ||
{ | ||
entry.PostedDate = DateTime.Now; | ||
_entries.Add(entry); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Guestbook.Domain/Repositories/IGuestbookEntryRepository.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.Linq; | ||
using Guestbook.Domain.Entities; | ||
|
||
namespace Guestbook.Domain.Repositories | ||
{ | ||
public interface IGuestbookEntryRepository | ||
{ | ||
IQueryable<GuestbookEntry> Entries { get; } | ||
void AddEntry(GuestbookEntry entry); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<configuration> | ||
<configSections> | ||
<sectionGroup name="NUnit"> | ||
<section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/> | ||
</sectionGroup> | ||
</configSections> | ||
<NUnit> | ||
<TestRunner> | ||
<!-- WatiN can only host IE in STA mode --> | ||
<add key="ApartmentState" value="STA"/> | ||
</TestRunner> | ||
</NUnit> | ||
|
||
<appSettings> | ||
<add key="RootUrl" value="http://localhost:8080/"/> | ||
</appSettings> | ||
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Feature: Browsing | ||
In order to see who's been on the site | ||
As a user | ||
I want to be able to view the list of posts | ||
|
||
Scenario: Navigation to homepage | ||
When I navigate to /Guestbook | ||
Then I should be on the guestbook page | ||
|
||
Scenario: Viewing existing entries | ||
Given I am on the guestbook page | ||
Then I should see a list of guestbook entries | ||
And guestbook entries have an author | ||
And guestbook entries have a posted date | ||
And guestbook entries have a comment |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
Feature: Posting | ||
In order to express my views | ||
As a user | ||
I want to be able to post entries into the guestbook | ||
|
||
Scenario: Navigation to posting page | ||
Given I am on the guestbook page | ||
Then I should see a button labelled "Post a New Entry" | ||
When I click the button labelled "Post a New Entry" | ||
Then I am on the posting page | ||
|
||
Scenario: Viewing the posting page | ||
Given I am on the posting page | ||
Then I should see a field labelled "Your name" | ||
And I should see a field labelled "Your comment" | ||
|
||
Scenario: Posting a valid entry | ||
Given I am on the posting page | ||
And I have filled out the form as follows | ||
| Label | Value | | ||
| Your name | Jakob | | ||
| Your comment | Das ist gut! | | ||
When I click the button labelled "Post" | ||
Then I should be on the guestbook page | ||
And I see the flash message "Thanks for posting!" | ||
And the guestbook entries includes the following | ||
| Name | Comment | Posted date | | ||
| Jakob | Das ist gut! | (within last minute) | | ||
|
||
|
||
|
Oops, something went wrong.