public void Create() { string p = Assembly.GetExecutingAssembly().GetLocalPath(); FileActionFactory f = new FileActionFactory(); Action a = f.FromFile(p); var sp = (StartProcess)a.CommandObject; Assert.AreEqual(p, sp.FileName); }
public void AddOrUpdate() { var dbPath = TestFile("test_actions.sqlite"); dbPath.EnsureFileNotExists(); using (var actions = new Collection <Action>(dbPath)) { var f = new FileActionFactory(); var a0 = f.FromFile(dbPath); actions.AddOrUpdate(a0); Assert.AreEqual(1, actions.Count); var a1 = f.FromFile(dbPath); actions.AddOrUpdate(a1); Assert.AreEqual(1, actions.Count); } }