public override void SetUp ()
        {
            base.SetUp ();

            ServiceContainer.Register<ISettingsStore> (Mock.Of<ISettingsStore> (
                        (store) => store.ExperimentId == (string)null));
            ServiceContainer.Register<ITimeProvider> (Mock.Of<ITimeProvider> (
                        (p) => p.Now == new DateTime (2014, 1, 1) &&
            p.TimeZoneId == "UTC" &&
            p.UtcNow == new DateTime (2014, 1, 1, 0, 0, 0, DateTimeKind.Utc)));

            manager = new ExperimentManager (typeof (Registry));
        }
 public ExperimentChangedMessage(ExperimentManager sender) : base(sender)
 {
 }
 public ExperimentChangedMessage (ExperimentManager sender) : base (sender)
 {
 }
        public void TestRestore()
        {
            ServiceContainer.Register<ISettingsStore> (Mock.Of<ISettingsStore> (
                        (store) => store.ExperimentId == "always"));

            manager = new ExperimentManager (typeof (Registry));
            Assert.AreEqual (Registry.AnyTime, manager.CurrentExperiment);
        }
        public void TestRestoreInvalid()
        {
            ServiceContainer.Register<ISettingsStore> (Mock.Of<ISettingsStore> (
                        (store) => store.ExperimentId == "someInvalidId"));

            manager = new ExperimentManager (typeof (Registry));
            Assert.IsNull (manager.CurrentExperiment);
        }