/// <summary> /// Processes each record. /// </summary> protected override void ProcessRecord() { IAction action = new ReferenceAction(Name, Variable, Value); action.Execute(TestSuite); WriteObject(TestSuite); WriteVerbose(action.Display); }
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)); }
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)); }