Esempio n. 1
0
        /// <summary>
        /// Processes each record.
        /// </summary>
        protected override void ProcessRecord()
        {
            IAction action = new ReferenceAction(Name, Variable, Value);

            action.Execute(TestSuite);
            WriteObject(TestSuite);
            WriteVerbose(action.Display);
        }
Esempio n. 2
0
        public void Execute_NewReferenceConnectionString_ReferenceAdded()
        {
            var state = new GenerationState();

            var action = new ReferenceAction("myRef", "ConnectionString", ConnectionStringValue);

            action.Execute(state);
            var target = state.Settings.References.FirstOrDefault(x => x.Name == "myRef");

            Assert.That(target, Is.Not.Null);
            Assert.That(target.ConnectionStringSpecified, Is.True);
            Assert.That(target.ConnectionString.Inline, Is.EqualTo(ConnectionStringValue));
        }
Esempio n. 3
0
        public void Execute_OverrideExistingReferenceConnectionString_ReferenceOverriden()
        {
            var state = new GenerationState();

            state.Settings.References.Add(new ReferenceXml()
            {
                Name = "myRef", ConnectionString = new ConnectionStringXml()
                {
                    Inline = "other connString"
                }
            });

            var action = new ReferenceAction("myRef", "ConnectionString", ConnectionStringValue);

            action.Execute(state);
            var target = state.Settings.References.FirstOrDefault(x => x.Name == "myRef");

            Assert.That(target, Is.Not.Null);
            Assert.That(target.ConnectionStringSpecified, Is.True);
            Assert.That(target.ConnectionString.Inline, Is.EqualTo(ConnectionStringValue));
        }