Skip to content

Commit

Permalink
Renamed Contact to Person.
Browse files Browse the repository at this point in the history
Removed some auto-generated stuff VS2010 added for me.
Added Backbone and Underscore javascript packages.
  • Loading branch information
Cory Nabours committed Jul 29, 2011
1 parent c63d88f commit fe0360b
Show file tree
Hide file tree
Showing 26 changed files with 79 additions and 517 deletions.
2 changes: 1 addition & 1 deletion NaboursCRM.Service.Tests/NaboursCRM.Service.Tests.csproj
Expand Up @@ -47,7 +47,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ContactsTests.cs" />
<Compile Include="PersonServiceTests.cs" />
<Compile Include="GenericServiceTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
Expand Down
Expand Up @@ -8,25 +8,25 @@
namespace NaboursCRM.Service.Tests
{
[TestFixture]
public class ContactsTests
public class PersonServiceTests
{

protected MockRepository _mocks;
protected Contacts _contactsService;
protected PersonService _contactsService;
protected PersonRepository _repository;

[SetUp]
public void Initialize()
{
_mocks = new MockRepository();
_repository = _mocks.DynamicMock<PersonRepository>();
_contactsService = new Contacts(_repository);
_contactsService = new PersonService(_repository);
}

[Test]
public void ShouldBeCreatable()
{
Assert.DoesNotThrow(delegate { new Contacts(); });
Assert.DoesNotThrow(delegate { new PersonService(); });
}

[Test]
Expand All @@ -35,7 +35,7 @@ public void ShouldBeAbletoGetListofContacts()
var results = new List<Person>();
_repository.Expect(r => r.GetAll()).Return(results);
_mocks.ReplayAll();
var contacts = _contactsService.GetContacts();
var contacts = _contactsService.GetPeople();
_mocks.VerifyAll();
Assert.AreEqual(results, contacts);
}
Expand All @@ -47,7 +47,7 @@ public void ShouldBeAbleToGetAContact()
var id = Guid.NewGuid();
_repository.Expect(r => r.GetPerson(id)).Return(samplePerson);
_mocks.ReplayAll();
var contact = _contactsService.GetContact(id.ToString());
var contact = _contactsService.GetPerson(id.ToString());
_mocks.VerifyAll();
Assert.AreSame(samplePerson, contact);
}
Expand Down
Expand Up @@ -7,15 +7,15 @@
namespace NaboursCRM.Service
{
[ServiceContract]
public interface IContacts
public interface IPersonService
{
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "/")]
List<Person> GetContacts();
List<Person> GetPeople();

[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json, UriTemplate = "/{id}")]
Person GetContact(string id);
Person GetPerson(string id);

[OperationContract]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json, UriTemplate = "/")]
Expand Down
4 changes: 2 additions & 2 deletions NaboursCRM.Service/NaboursCRM.Service.csproj
Expand Up @@ -42,8 +42,8 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Contacts.cs" />
<Compile Include="IContacts.cs" />
<Compile Include="PersonService.cs" />
<Compile Include="IPersonService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
Expand Up @@ -8,29 +8,29 @@
namespace NaboursCRM.Service
{
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Contacts : IContacts
public class PersonService : IPersonService
{
private readonly PersonRepository _repository;

public Contacts() : this(new PersonData())
public PersonService() : this(new PersonData())
{

}

public Contacts(PersonRepository repository)
public PersonService(PersonRepository repository)
{
_repository = repository;
}


public List<Person> GetContacts()
public List<Person> GetPeople()
{
var result = _repository.GetAll();
RemovePotentialHibernateImplementationsOfIList(result);
return (List<Person>)result;
}

public Person GetContact(string id)
public Person GetPerson(string id)
{
var result = _repository.GetPerson(new Guid(id));
RemovePotentialHibernateImplementationsOfIList(result);
Expand Down
13 changes: 0 additions & 13 deletions NaboursCRM/About.aspx

This file was deleted.

17 changes: 0 additions & 17 deletions NaboursCRM/About.aspx.cs

This file was deleted.

17 changes: 0 additions & 17 deletions NaboursCRM/About.aspx.designer.cs

This file was deleted.

60 changes: 0 additions & 60 deletions NaboursCRM/Account/ChangePassword.aspx

This file was deleted.

17 changes: 0 additions & 17 deletions NaboursCRM/Account/ChangePassword.aspx.cs

This file was deleted.

26 changes: 0 additions & 26 deletions NaboursCRM/Account/ChangePassword.aspx.designer.cs

This file was deleted.

13 changes: 0 additions & 13 deletions NaboursCRM/Account/ChangePasswordSuccess.aspx

This file was deleted.

17 changes: 0 additions & 17 deletions NaboursCRM/Account/ChangePasswordSuccess.aspx.cs

This file was deleted.

17 changes: 0 additions & 17 deletions NaboursCRM/Account/ChangePasswordSuccess.aspx.designer.cs

This file was deleted.

49 changes: 0 additions & 49 deletions NaboursCRM/Account/Login.aspx

This file was deleted.

17 changes: 0 additions & 17 deletions NaboursCRM/Account/Login.aspx.cs

This file was deleted.

0 comments on commit fe0360b

Please sign in to comment.