Esempio n. 1
0
 /// <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);
     }
 }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
 /// <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);
 }
Esempio n. 4
0
 public void Client_NoWorkTypeGivesDefaultChargeCode()
 {
     var client = new Client("Foo", "default");
     Assert.AreEqual("default", client.GetChargeCodeFromWorkType(string.Empty));
 }
Esempio n. 5
0
 public void Client_WorkTypeGivenDefaultChargeCode()
 {
     var client = new Client("Foo", "default");
     client.AddWorkType("work");
     Assert.AreEqual("default", client.GetChargeCodeFromWorkType("work"));
 }
Esempio n. 6
0
 public void Client_HasNoDefaultChargeCode()
 {
     var client = new Client("Foo");
     Assert.IsTrue(string.IsNullOrEmpty(client.DefaultChargeCode));
 }
Esempio n. 7
0
 public void Client_HasDefaultChargeCode()
 {
     var client = new Client("Foo", "default charge code");
     Assert.AreEqual("default charge code", client.DefaultChargeCode);
 }
Esempio n. 8
0
 public void Client_HasCorrectName()
 {
     var client = new Client("Foo");
     Assert.AreEqual("Foo", client.Name);
 }
Esempio n. 9
0
 public void Client_DuplicateWorkTypesUnderDifferentChargeCodesThrows()
 {
     var client = new Client("Foo", "default");
     client.AddWorkType("type", "Foo1");
     client.AddWorkType("type", "Foo2");
 }
Esempio n. 10
0
 public void Client_DuplicateWorkTypeDoesntThrow()
 {
     var client = new Client("Foo", "default");
     client.AddWorkType("type");
     client.AddWorkType("type");
 }