[Test]
public void TestUserProfileInsert()
{
using (new TestBindingsWrapper("TestBindings", "", new TestModule()))
{
// Setup the mock the dataprovider
MyMocks.MockDataProvider.Setup(x => x.InsertUserProfile(It.IsAny<IUserProfile>())).Returns(1);
IUserProfile up = new UserProfile();
IUserProfileManager manager = new UserProfileManager();
int result = manager.Insert(up);
Assert.AreEqual(1, result);
MyMocks.MockDataProvider.Verify(x => x.InsertUserProfile(up), Times.Once());
}
}
私もninjectを使用しています。戻り値を設定しているように見えますが、実際にテストされているのは何ですか?これは冗談ですか、それとも何か不足していますか?