public void SetInitial(string sessionId, string data) { actionQueue.QueueCommand(sessionId, () => { logging.Log($"Starting Duplicate on {sessionId}"); service.SetInitial(sessionId, data); logging.Log($"Duplicate on {sessionId} done"); }); }
public void CanSetInitialValue() { var mocks = new MockRepository(MockBehavior.Strict); var mapper = mocks.Create <ISessionMapper>(); var persistor = mocks.Create <IPersister>(); mapper.Setup(s => s.StartOrGetSession(It.IsAny <string>())).Returns <string>(s => $"{s}_dalSession"); persistor.Setup(s => s.SetData(It.IsAny <string>(), It.IsAny <string>())); var service = new ImportantService( mapper.Object, mocks.Create <IAccessor>().Object, persistor.Object, Mock.Of <ILogging>() ); service.SetInitial("SessionId", "SomeData"); mocks.VerifyAll(); }