コード例 #1
0
        public void TestFindFailure()
        {
            // arrange
            var fixture = new InMemory();

            // act assert
            Assert.ThrowsException <ArgumentOutOfRangeException>(() => fixture.Remove("*****@*****.**"));
        }
コード例 #2
0
        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);
        }
コード例 #6
0
        //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);
        }