Open amindadgar opened 1 year ago
I'm writing the first test case for "Your followers" section.
Test Case 1. Here is the data we need to insert
MERGE (a1:TwitterAccount {userId: '1111'})
MERGE (a2:TwitterAccount {userId: '1112'})
MERGE (a3:TwitterAccount {userId: '1113'})
SET a1.followerCount = 0
SET a2.followerCount = 3
SET a3.followerCount = 9
SET a1.followingCount = 12
SET a2.followingCount = 20
SET a3.followingCount = 50
Expected results for user with userId 1111
Expected results for user with userId 1112
Expected results for user with userId 1113
Test Case 2: The query to insert
MERGE (a1:TwitterAccount {userId: '1111'})
MERGE (a2:TwitterAccount {userId: '1112'})
MERGE (a3:TwitterAccount {userId: '1113'})
Expected results for all the three users must be null.
The test cases for the widget "Accounts that engage with you"
Test Case 1: The data we need to insert
MERGE (a:TwitterAccount {userId: "1111"})
MERGE (a2:TwitterAccount {userId: "1112"})
MERGE (t:Tweet {tweetId: "123", authorId: "1111", createdAt: {Epoch4daysAgo}})
MERGE (t2:Tweet {tweetId: '124', authorId: "1111", createdAt: {Epoch5daysAgo}})
MERGE (t3:Tweet {tweetId: '125', authorId: "1112", createdAt: {Epoch2daysAgo}})
MERGE (t4:Tweet {tweetId: '126', authorId: "1111", createdAt: {Epoch1daysAgo}})
MERGE (t5:Tweet {tweetId: '127', authorId: "1112", createdAt: {Epoch3daysAgo}})
MERGE (a)-[:TWEETED {createdAt: '{Epoch2dayAgo}']->(t)
MERGE (a)-[:TWEETED {createdAt: '{Epoch1dayAgo}']->(t4)
MERGE (t2)-[:REPLIED {createdAt: '{Epoch1dayAgo}']->(t)
MERGE (t3)-[:REPLIED {createdAt: '{Epoch2dayAgo}']->(t) // 1
MERGE (t5)-[:REPLIED {createdAt: '{Epoch4dayAgo}']->(t4) // 2
MERGE (t2)-[:RETWEETED {createdAt: '{Epoch1dayAgo}']->(t)
MERGE (t3)-[:REPLIED {createdAt: '{Epoch2dayAgo}']->(t) // 3
MERGE (t5)-[:RETWEETED {createdAt: '{Epoch4dayAgo}']->(t4) // 4
MERGE (a)-[:LIKED {latestSavedAt: {Epoch1dayAgo}]->(t)
MERGE (a)-[:LIKED {latestSavedAt: {Epoch1dayAgo}]->(t2)
MERGE (a2)-[:LIKED {latestSavedAt: {Epoch1dayAgo}]->(t3)
MERGE (a2)-[:LIKED {latestSavedAt: {Epoch3dayAgo}]->(t) // 5
MERGE (a2)-[:LIKED {latestSavedAt: {Epoch1dayAgo}]->(t5)
MERGE (t) -[:MENTIONED {createdAt: '{Epoch2dayAgo}'] -> (a)
MERGE (t2) -[:MENTIONED {createdAt: '{Epoch3dayAgo}'] -> (a1)
MERGE (t3) -[:MENTIONED {createdAt: '{Epoch4dayAgo}'] -> (a1) // 6
The expected results for the account with userId 1111
should be 1
.
The expected results for the account with userId 1112
should be 0
.
Here we're gonna write down the tests for the "account activity" section of twitter dashboard. We would need to write test cases for two parts