public void Test() { WriteEvent(); var thread = new Thread(EntryPoint.Main); thread.Start(); Thread.Sleep(15000); var stateStorage = new GameficationStateStorage(); var actualState = stateStorage.TryGetState(10); Assert.AreNotEqual(null, actualState); Assert.AreEqual(100, actualState.Loyalty); }
public void Test() { //using (var db = new ApplicationContext()) //{ // db.ClearDatabase(); // db.EnsureDatabaseCreated(); //} var storage = new GameficationStateStorage(); var expectedState = new SqlGameficationState { UserId = 12, Loyalty = 100, }; storage.UpdateState(expectedState); var actualState = storage.TryGetState(12); Assert.AreNotEqual(null, actualState); Assert.AreEqual(expectedState.UserId, actualState.UserId); Assert.AreEqual(expectedState.Loyalty, actualState.Loyalty); }