Пример #1
0
        public void TestFindFailure()
        {
            // arrange
            var fixture = new InMemory();

            // act assert
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => fixture.Remove("*****@*****.**"));
        }
        public void Remove_Blab_GetById_Success()
        {
            // Arrange
            string Email    = "*****@*****.**";
            Blab   Expected = (Blab)_harness.GetByUserId(Email);

            _harness.Remove(Expected);

            // Act
            Blab Actual = (Blab)_harness.GetByUserId(Email);

            // Assert
            Assert.AreNotEqual(Expected, Actual);
        }
Пример #3
0
        public void TestRemoveFailure()
        {
            // arrange
            var fixture = new InMemory();
            var usr     = new UserEntity();

            usr.SetId("*****@*****.**");
            // act assert
            fixture.Create(usr);
            var actual = fixture.Count();

            Assert.AreEqual(1, actual);
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => fixture.Remove("*****@*****.**"));
        }
Пример #4
0
        public void Remove_Blab_BySysId()
        {
            User newUser = new User();

            newUser.ChangeEmail("*****@*****.**");
            _harness.Add(newUser);
            int ogLength = _harness.GetDataSetLength();

            _harness.Remove(newUser);
            int  newLength = _harness.GetDataSetLength();
            bool correct   = false;

            if (newLength == (ogLength - 1))
            {
                correct = true;
            }
            Assert.AreEqual(true, correct);
        }
Пример #5
0
        public void TestRemoveSuccess()
        {
            // arrange
            var fixture  = new InMemory();
            var expected = 0;
            var usr      = new UserEntity();

            usr.SetId("*****@*****.**");
            // act
            fixture.Create(usr);
            var actual = fixture.Count();

            Assert.AreEqual(1, actual);
            fixture.Remove("*****@*****.**");
            actual = fixture.Count();
            // assert
            Assert.AreEqual(expected, actual);
        }
        //Class for testing the adding of a blab and getting a user by ID
        public void Remove_Blab_BySysId()
        {
            Blab newBlab = new Blab();

            newBlab.Message = "Hello, this is Chris blabbing for the first time";
            newBlab.UserID  = "*****@*****.**";
            _harness.Add(newBlab);
            int ogLength = _harness.GetDataSetLength();

            _harness.Remove(newBlab);
            int  newLength = _harness.GetDataSetLength();
            bool correct   = false;

            if (newLength == (ogLength - 1))
            {
                correct = true;
            }
            Assert.AreEqual(true, correct);
        }