I hereby claim:
- I am tallseth on github.
- I am sethmccarthy (https://keybase.io/sethmccarthy) on keybase.
- I have a public key ASAJa6K8j1PB4QAREEzIlU-io81ldsCF0L59XDXcfeg8Ggo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
public class ProxyTest | |
{ | |
public static void AssertProxyDelegation<T,U>(T proxy, Mock<T> proxiedMock, Expression<Func<T,U>> func, U retVal) where T : class | |
{ | |
proxiedMock.Setup(func).Returns(retVal); | |
Assert.That(func.Compile().Invoke(proxy), Is.SameAs(retVal)); | |
} | |
public static void AssertProxyDelegation<T>(T delegator, Mock<T> delegatedTo, Expression<Action<T>> action) where T : class | |
{ |
//works | |
public void Update(Job job) | |
{ | |
//How do you unit test this line without communicating with a DB? | |
context_.Entry(job).State = EntityState.Modified; | |
context_.SaveChanges(); | |
} | |
//doesn't work | |
public void Update(Job job) |