Commits

alexdavies74  committed dfe2e65

Third provided example

  • Participants
  • Parent commits 7b0f917

Comments (0)

Files changed (1)

File DataStoreChallenge/Tests/DataStoreTests.cs

             Assert.That(m_DataStore.Rollback(), Is.EqualTo(false));
         }
 
+        [Test]
+        public void ProvidedExample3()
+        {
+            m_DataStore.Set("a", "50");
+            m_DataStore.Begin();
+            Assert.That(m_DataStore.Get("a"), Is.EqualTo("50"));
+            m_DataStore.Set("a", "60");
+            m_DataStore.Begin();
+            m_DataStore.UnSet("a");
+            Assert.That(m_DataStore.Get("a"), Is.Null);
+            Assert.That(m_DataStore.Rollback(), Is.EqualTo(true));
+            Assert.That(m_DataStore.Get("a"), Is.EqualTo("60"));
+            m_DataStore.Commit();
+            Assert.That(m_DataStore.Get("a"), Is.EqualTo("60"));
+        }
+
 
     }
 }