public ServerEntrieCollectionSubstitute() { var serverEntryCollection = new ServerEntryCollection(); typeof(ServerEntryCollection) .GetField("entries", BindingFlags.NonPublic | BindingFlags.Instance) .SetValue(serverEntryCollection, this.entries); predefinedServerEntries.SetValue(null, serverEntryCollection); }
public ServerEntryCollectionTests() { this.entryCollection = new ServerEntryCollection(); }
/// <summary>Fills private entries field.</summary> /// <param name="collection">The target collection.</param> /// <param name="entries">The entries to fill.</param> private void FillEntries(ServerEntryCollection collection, List <ServerEntry> entries) { typeof(ServerEntryCollection) .GetField("entries", BindingFlags.NonPublic | BindingFlags.Instance) .SetValue(collection, entries); }