public void UsesAuthorizationTest() { var mockAuthorizer = MockRepository.GenerateMock<IAuthorizer>(); mockAuthorizer.Stub(x => x.IsAuthorized("Token1")).Return(true); var testUser = new UsesAuthorization(mockAuthorizer); string result = testUser.AccessAuthorizedResource(); Assert.That(result, Is.EqualTo("Authorized Resource")); }
public void UsesAuthorizationTest() { var mockAuthorizer = MockRepository.GenerateMock <IAuthorizer>(); mockAuthorizer.Stub(x => x.IsAuthorized("Token1")).Return(true); var testUser = new UsesAuthorization(mockAuthorizer); string result = testUser.AccessAuthorizedResource(); Assert.That(result, Is.EqualTo("Authorized Resource")); }