Permalink
Browse files

self-review of new unit tests

  • Loading branch information...
1 parent 797e8c2 commit a737a17be99d2a9fe641e8c9f2d310d89e08b28f @half-ogre half-ogre committed Mar 20, 2012
@@ -26,7 +26,7 @@ public void WillThrowWhenCuratedFeedDoesNotExist()
public void WillThrowWhenPackageRegistrationDoesNotExist()
{
var cmd = new TestableCreateCuratedPackageCommand();
- cmd.StubPackageRegistrationByKeyQuery
+ cmd.StubPackageRegistrationByKeyQry
.Setup(stub => stub.Execute(It.IsAny<int>(), It.IsAny<bool>()))
.Returns((PackageRegistration)null);
@@ -98,12 +98,12 @@ public TestableCreateCuratedPackageCommand()
StubCuratedFeedByKeyQry = new Mock<ICuratedFeedByKeyQuery>();
StubEntitiesContext = new Mock<IEntitiesContext>();
StubPackageRegistration = new PackageRegistration { Key = 0, };
- StubPackageRegistrationByKeyQuery = new Mock<IPackageRegistrationByKeyQuery>();
+ StubPackageRegistrationByKeyQry = new Mock<IPackageRegistrationByKeyQuery>();
StubCuratedFeedByKeyQry
.Setup(stub => stub.Execute(It.IsAny<int>(), It.IsAny<bool>()))
.Returns(StubCuratedFeed);
- StubPackageRegistrationByKeyQuery
+ StubPackageRegistrationByKeyQry
.Setup(stub => stub.Execute(It.IsAny<int>(), It.IsAny<bool>()))
.Returns(StubPackageRegistration);
@@ -114,15 +114,15 @@ public TestableCreateCuratedPackageCommand()
public Mock<ICuratedFeedByKeyQuery> StubCuratedFeedByKeyQry { get; set; }
public Mock<IEntitiesContext> StubEntitiesContext { get; private set; }
public PackageRegistration StubPackageRegistration { get; set; }
- public Mock<IPackageRegistrationByKeyQuery> StubPackageRegistrationByKeyQuery { get; set; }
+ public Mock<IPackageRegistrationByKeyQuery> StubPackageRegistrationByKeyQry { get; set; }
protected override T GetService<T>()
{
if (typeof(T) == typeof(ICuratedFeedByKeyQuery))
return (T) StubCuratedFeedByKeyQry.Object;
if (typeof(T) == typeof(IPackageRegistrationByKeyQuery))
- return (T) StubPackageRegistrationByKeyQuery.Object;
+ return (T) StubPackageRegistrationByKeyQry.Object;
throw new Exception("Tried to get unexpected service");
}
@@ -215,7 +215,7 @@ public void WillModifyTheCuratedPackageWhenRequestIsValid()
controller.PatchCuratedPackage("theCuratedFeedName", "theCuratedPackageId", new ModifyCuratedPackageRequest{ Included = true});
- controller.StubModifyCuratedPackageCommand.Verify(stub => stub.Execute(
+ controller.StubModifyCuratedPackageCmd.Verify(stub => stub.Execute(
42,
1066,
true));
@@ -290,7 +290,7 @@ public void WillDeleteTheCuratedPackageWhenRequestIsValid()
controller.DeleteCuratedPackage("theCuratedFeedName", "theCuratedPackageId");
- controller.StubDeleteCuratedPackageCommand.Verify(stub => stub.Execute(
+ controller.StubDeleteCuratedPackageCmd.Verify(stub => stub.Execute(
42,
1066));
}
@@ -326,9 +326,9 @@ protected TestableCuratedPackagesControllerBase()
StubCreatedCuratedPackageCmd = new Mock<ICreateCuratedPackageCommand>();
StubCuratedFeed = new CuratedFeed { Key = 0, Name = "aName", Managers = new HashSet<User>( new []{ new User { Username = "aUsername" } }) };
StubCuratedFeedByNameQry = new Mock<ICuratedFeedByNameQuery>();
- StubDeleteCuratedPackageCommand = new Mock<IDeleteCuratedPackageCommand>();
+ StubDeleteCuratedPackageCmd = new Mock<IDeleteCuratedPackageCommand>();
StubIdentity = new Mock<IIdentity>();
- StubModifyCuratedPackageCommand = new Mock<IModifyCuratedPackageCommand>();
+ StubModifyCuratedPackageCmd = new Mock<IModifyCuratedPackageCommand>();
StubPackageRegistration = new PackageRegistration { Key = 0, Id = "anId" };
StubPackageRegistrationByIdQry = new Mock<IPackageRegistrationByIdQuery>();
@@ -339,9 +339,9 @@ protected TestableCuratedPackagesControllerBase()
public Mock<ICreateCuratedPackageCommand> StubCreatedCuratedPackageCmd { get; set; }
public CuratedFeed StubCuratedFeed { get; set; }
public Mock<ICuratedFeedByNameQuery> StubCuratedFeedByNameQry { get; private set; }
- public Mock<IDeleteCuratedPackageCommand> StubDeleteCuratedPackageCommand { get; private set; }
+ public Mock<IDeleteCuratedPackageCommand> StubDeleteCuratedPackageCmd { get; private set; }
public Mock<IIdentity> StubIdentity { get; private set; }
- public Mock<IModifyCuratedPackageCommand> StubModifyCuratedPackageCommand { get; private set; }
+ public Mock<IModifyCuratedPackageCommand> StubModifyCuratedPackageCmd { get; private set; }
public PackageRegistration StubPackageRegistration { get; private set; }
public Mock<IPackageRegistrationByIdQuery> StubPackageRegistrationByIdQry { get; private set; }
@@ -359,10 +359,10 @@ protected override T GetService<T>()
return (T)StubCuratedFeedByNameQry.Object;
if (typeof(T) == typeof(IDeleteCuratedPackageCommand))
- return (T)StubDeleteCuratedPackageCommand.Object;
+ return (T)StubDeleteCuratedPackageCmd.Object;
if (typeof(T) == typeof(IModifyCuratedPackageCommand))
- return (T)StubModifyCuratedPackageCommand.Object;
+ return (T)StubModifyCuratedPackageCmd.Object;
if (typeof(T) == typeof(IPackageRegistrationByIdQuery))
return (T)StubPackageRegistrationByIdQry.Object;

0 comments on commit a737a17

Please sign in to comment.