/// <summary> /// Remove a client from the collection. /// </summary> /// <param name="client">The client to be removed.</param> public void RemoveClient(Client client) { var clientToRemove = _clients.FirstOrDefault(c => c.Name == client.Name); if (clientToRemove != null) { _clients.Remove(clientToRemove); } }
/// <summary> /// Creates a new <see cref="XMLClientManager"/>. /// </summary> public XMLClientManager() { var client = new Client("Hasbro", "HB"); client.AddWorkType("Federal"); _clients.Add(client); client = new Client("Bank of America", "BOA"); client.AddWorkType("Federal"); client.AddWorkType("State", "BOAS"); _clients.Add(client); }
/// <summary> /// Add a client to the collection. /// </summary> /// <param name="client">The client to be added.</param> public void AddClient(Client client) { _clients.Add(client); }
public void Client_NoWorkTypeGivesDefaultChargeCode() { var client = new Client("Foo", "default"); Assert.AreEqual("default", client.GetChargeCodeFromWorkType(string.Empty)); }
public void Client_WorkTypeGivenDefaultChargeCode() { var client = new Client("Foo", "default"); client.AddWorkType("work"); Assert.AreEqual("default", client.GetChargeCodeFromWorkType("work")); }
public void Client_HasNoDefaultChargeCode() { var client = new Client("Foo"); Assert.IsTrue(string.IsNullOrEmpty(client.DefaultChargeCode)); }
public void Client_HasDefaultChargeCode() { var client = new Client("Foo", "default charge code"); Assert.AreEqual("default charge code", client.DefaultChargeCode); }
public void Client_HasCorrectName() { var client = new Client("Foo"); Assert.AreEqual("Foo", client.Name); }
public void Client_DuplicateWorkTypesUnderDifferentChargeCodesThrows() { var client = new Client("Foo", "default"); client.AddWorkType("type", "Foo1"); client.AddWorkType("type", "Foo2"); }
public void Client_DuplicateWorkTypeDoesntThrow() { var client = new Client("Foo", "default"); client.AddWorkType("type"); client.AddWorkType("type"); }