Skip to content

Commit

Permalink
Refactor: Genre renamed to Subject
Browse files Browse the repository at this point in the history
  • Loading branch information
ajlopez committed Apr 7, 2013
1 parent 1c9ab86 commit 966aeb5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
Expand Up @@ -10,20 +10,20 @@
using MyLibrary.Web.Models;

[TestClass]
public class GenreControllerTests
public class SubjectControllerTests
{
[TestMethod]
public void GetGenres()
public void GetSubjects()
{
IList<Genre> genres = new List<Genre>()
IList<Subject> genres = new List<Subject>()
{
new Genre() { Name = "Mathematics" },
new Genre() { Name = "Physics" },
new Genre() { Name = "Biology" },
new Genre() { Name = "Literature" }
new Subject() { Name = "Mathematics" },
new Subject() { Name = "Physics" },
new Subject() { Name = "Biology" },
new Subject() { Name = "Literature" }
};

GenreController controller = new GenreController(genres);
SubjectController controller = new SubjectController(genres);

ActionResult result = controller.Index();

Expand All @@ -32,7 +32,7 @@ public void GetGenres()

ViewResult viewResult = (ViewResult)result;

Assert.IsInstanceOfType(viewResult.ViewData.Model, typeof(IList<Genre>));
Assert.IsInstanceOfType(viewResult.ViewData.Model, typeof(IList<Subject>));
Assert.AreSame(genres, viewResult.ViewData.Model);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Src/MyLibrary.Web.Tests/MyLibrary.Web.Tests.csproj
Expand Up @@ -97,7 +97,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Controllers\GenreControllerTests.cs" />
<Compile Include="Controllers\SubjectControllerTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
Expand Up @@ -7,15 +7,15 @@
using System.Web.Mvc;
using MyLibrary.Web.Models;

public class GenreController : Controller
public class SubjectController : Controller
{
private IList<Genre> genres;
private IEnumerable<Subject> genres;

public GenreController()
public SubjectController()
{
}

public GenreController(IList<Genre> genres)
public SubjectController(IEnumerable<Subject> genres)
{
this.genres = genres;
}
Expand Down
Expand Up @@ -5,7 +5,7 @@
using System.Linq;
using System.Web;

public class Genre
public class Subject
{
public string Name { get; set; }
}
Expand Down
4 changes: 2 additions & 2 deletions Src/MyLibrary.Web/MyLibrary.Web.csproj
Expand Up @@ -104,11 +104,11 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Controllers\GenreController.cs" />
<Compile Include="Controllers\SubjectController.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Models\Genre.cs" />
<Compile Include="Models\Subject.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down

0 comments on commit 966aeb5

Please sign in to comment.