Пример #1
0
        ////[TestCase("Black", 22)]
        public void GetFirstUserByLastNameAndAge_FirstNameAlexLastNameBlack_FirstUserWithFirstNameAlexLastNameBlack(
            string first, int age)
        {
            User user1 = new User()
            {
                FirstName = "Alex", LastName = "Black", Age = 22
            };
            User user2 = new User()
            {
                FirstName = "Mike", LastName = "red", Age = 123
            };
            User user3 = new User()
            {
                FirstName = "Sue", LastName = "Black", Age = 42
            };
            User user4 = new User()
            {
                FirstName = "Alex", LastName = "Black", Age = 22
            };

            UserStorageServiceMaster master = new UserStorageServiceMaster(new UserRepositoryWithState(), new List <UserStorageServiceSlave>(new[] { new UserStorageServiceSlave(new UserRepositoryWithState()), new UserStorageServiceSlave(new UserRepositoryWithState()) }));

            master.Add(user1);
            master.Add(user2);
            master.Add(user3);
            master.Add(user4);

            Assert.AreEqual(user1, master.GetFirstUserByLastNameAndAge(first, age));
            /// Assert.AreNotEqual(user4, master.GetFirstUserByLastNameAndAge(first, age));
        }