예제 #1
0
        public void ShouldRespondThatOtherUserNotFoundWhenConnecteeDoesNotExist()
        {
            //GIVEN
            var user1   = Root.Any.Instance <UserDto>();
            var context = new ApplicationLogicDriver();

            context.Start();
            context.UsersDatabaseContains(user1);

            //WHEN
            context.MakeAConnectionBetween(user1.Id, Root.Any.String());

            //THEN
            context.ResponseShouldSayOtherUserNotFound();
        }
예제 #2
0
        public void ShouldRespondThatUserNotFoundWhenConnectorDoesNotExist()
        {
            //GIVEN
            var user2   = Root.Any.Instance <UserDto>();
            var context = new ApplicationLogicDriver();

            context.Start();

            context.UsersDatabaseContains(user2);

            //WHEN
            context.MakeAConnectionBetween(Root.Any.String(), user2.Id);

            //THEN
            context.DatabaseShouldNotBeUpdated();
            context.ResponseShouldSayUserNotFound();
        }
예제 #3
0
        public void ShouldRespondThatOtherUserIdIsInvalidWhenConnectorIdIsRejectedByDatabase()
        {
            //GIVEN
            var user1   = Root.Any.Instance <UserDto>();
            var context = new ApplicationLogicDriver();

            context.Start();
            var user2Id = Root.Any.String();

            context.UsersDatabaseContains(user1);
            context.UsersDatabaseRejects(user2Id);

            //WHEN
            context.MakeAConnectionBetween(user1.Id, user2Id);

            //THEN
            context.DatabaseShouldNotBeUpdated();
            context.ResponseShouldSayOtherUserIdInvalid();
        }
예제 #4
0
        public void ShouldSaveUserWithConnectionToOtherAndReturnOtherUserWithConnectionToUserWhenBothUsersExist()
        {
            //GIVEN
            var user1   = Root.Any.Instance <UserDto>();
            var user2   = Root.Any.Instance <UserDto>();
            var context = new ApplicationLogicDriver();

            context.Start();

            context.UsersDatabaseContains(user1);
            context.UsersDatabaseContains(user2);

            //WHEN
            context.MakeAConnectionBetween(user1.Id, user2.Id);

            //THEN
            context.DatabaseShouldBeUpdatedWithConnectionFrom(user2, user1);
            context.ResponseShouldContainConnectionFrom(user1, user2);
        }