public void ActorSystemSettingsShouldStoreAndRetrieveSetup()
        {
            var setup  = new DummySetup("Ardbeg");
            var setups = ActorSystemSetup.Create(setup);

            setups.Get <DummySetup>().Should().Be(new Option <DummySetup>(setup));
            setups.Get <DummySetup2>().Should().Be(Option <DummySetup2> .None);
        }
        public void ActorSystemSettingsShouldReplaceSetupIfAlreadyDefined()
        {
            var setup1 = new DummySetup("Ardbeg");
            var setup2 = new DummySetup("Ledaig");
            var setups = ActorSystemSetup.Empty.WithSetup(setup1).WithSetup(setup2);

            setups.Get <DummySetup>().Should().Be(new Option <DummySetup>(setup2));
        }
        public void ActorSystemSettingsShouldBeCreatedWithSetOfSetups()
        {
            var setup1 = new DummySetup("Ardbeg");
            var setup2 = new DummySetup2("Ledaig");
            var setups = ActorSystemSetup.Create(setup1, setup2);

            setups.Get <DummySetup>().HasValue.Should().BeTrue();
            setups.Get <DummySetup2>().HasValue.Should().BeTrue();
            setups.Get <DummySetup3>().HasValue.Should().BeFalse();
        }
        public void ActorSystemSettingsShouldProvideFluentInterface()
        {
            var setup1 = new DummySetup("Ardbeg");
            var setup2 = new DummySetup("Ledaig");
            var setup3 = new DummySetup2("Blantons");
            var setups = setup1.And(setup2).And(setup3);

            setups.Get <DummySetup>().Should().Be(new Option <DummySetup>(setup2));
            setups.Get <DummySetup2>().Should().Be(new Option <DummySetup2>(setup3));
        }
        public void ActorSystemSettingsShouldBeAvailableFromExtendedActorSystem()
        {
            ActorSystem system = null;

            try
            {
                var setup = new DummySetup("Eagle Rare");
                system = ActorSystem.Create("name", ActorSystemSetup.Create(setup));

                system.Settings.Setup.Get <DummySetup>().Should().Be(new Option <DummySetup>(setup));
            }
            finally
            {
                system?.Terminate().Wait(TimeSpan.FromSeconds(5));
            }
        }