Inheritance: IStorageManager
Ejemplo n.º 1
0
 public void Setup()
 {
     using (IStorageManager manager = new StorageManager(null))
     {
         manager.DeleteAll();
     }
 }
Ejemplo n.º 2
0
 public void TestDefaultValues()
 {
     using (IStorageManager manager = new StorageManager(null))
     {
         IStorage stg1 = manager.StorageFor("cmd1");
         Assert.IsNull(stg1.Value);
         Assert.IsFalse(stg1.Contains("value1"));
     }
 }
Ejemplo n.º 3
0
        public void TestStorage()
        {
            const string subfield = "cmd1-subfield";
            const string subfieldValue = "command1 subfield value";

            using (IStorageManager manager = new StorageManager(null))
            {
                IStorage storage = manager.StorageFor(Command1Id);
                storage.Value = "command1 value";
                storage[subfield] = subfieldValue;
            }

            using (IStorageManager manager = new StorageManager(null))
            {
                IStorage storage = manager.StorageFor(Command1Id);
                Assert.AreEqual("command1 value", storage.Value);
                Assert.AreEqual(subfieldValue, storage[subfield]);
            }
        }
Ejemplo n.º 4
0
        public void TestStorageIsPerCommand()
        {
            const string command1Value = "command1 value";
            const string command2Value = "command2 value";

            using (IStorageManager manager = new StorageManager(null))
            {
                var value1 = SetValueFor(manager, Command1Id, command1Value);
                var value2 = SetValueFor(manager, Command2Id, command2Value);

                Assert.AreEqual(value1, command1Value);
                Assert.AreEqual(value2, command2Value);
            }

            using (IStorageManager manager = new StorageManager(null))
            {
                IStorage stg1 = manager.StorageFor(Command1Id);
                IStorage stg2 = manager.StorageFor(Command2Id);

                Assert.AreEqual(stg1.Value, command1Value);
                Assert.AreEqual(stg2.Value, command2Value);
            }
        }