예제 #1
0
        public void GivenValidConnectionDetails_WhenDeleteConnectionIsCalled_ReturnTrue()
        {
            using (var scope = Container.BeginLifetimeScope())
            {
                // Arrange
                Connection connection = new Connection()
                {
                    UserId      = 289,
                    OtherUserId = 10
                };

                _profilesService = scope.Resolve <ProfileService>();

                _profilesService.AddConnection(connection);

                // Act
                var result = _profilesService.DeleteConnection(connection);

                // Assert
                Assert.That(result, Is.Not.Null);
                Assert.That(result, Is.InstanceOf <bool>());
                Assert.That(result, Is.EqualTo(true));
                Assert.IsFalse(_profilesService.AreUsersConnected(connection)); // cleanup, undo database operations and assert it's been successful
            }
        }