Neon.Xunit.HostsFixture.Commit()

Here are the examples of the csharp api Neon.Xunit.HostsFixture.Commit() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 Source : HostsFixture.cs
with Apache License 2.0
from nforgeio

public void AddHostAddress(string hostname, string address, bool deferCommit = false)
        {
            Covenant.Requires<ArgumentNullException>(!string.IsNullOrEmpty(hostname), nameof(hostname));
            Covenant.Requires<ArgumentNullException>(!string.IsNullOrEmpty(address), nameof(address));

            foreach (var record in records)
            {
                if (record.Item1.Equals(hostname, StringComparison.InvariantCultureIgnoreCase) &&
                    record.Item2.Equals(address, StringComparison.InvariantCultureIgnoreCase))
                {
                    return;     // Don't add a duplicate record.
                }
            }

            records.Add(new Tuple<string, string>(hostname, address));

            if (!deferCommit)
            {
                Commit();
            }
        }