public void GetOrCreateNewDuplicateEntryShouldNotThrow() { InMemoryAccountTypeRepository subject = CreateSubject(); Engine.BankAccount.Account result1 = subject.GetByKey(Key1); Engine.BankAccount.Account result2 = subject.GetByKey(Key1); Assert.AreSame(result1, result2); }
public void AddingNewEntryShouldBeRetrievableByKey() { InMemoryAccountTypeRepository subject = CreateSubject(); ChequeAccount data = CreateTestData2(); subject.Add(Key1, data); Assert.AreEqual(data.Name, subject.GetByKey(Key1).Name); }
public void AddingDuplicateEntryShouldNotThrow() { InMemoryAccountTypeRepository subject = CreateSubject(); ChequeAccount data = CreateTestData2(); subject.Add(Key1, data); ChequeAccount data2 = CreateTestData2(); subject.Add(Key1, data2); Assert.AreEqual(data.Name, subject.GetByKey(Key1).Name); }