mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-10-22 17:32:16 +00:00
add createSndConn test
This commit is contained in:
1 file changed
+21
-4
@@ -22,11 +22,12 @@ withStore =
|
||||
storeTests :: Spec
|
||||
storeTests = withStore do
|
||||
describe "store methods" do
|
||||
describe "createRcvConnection" testCreateRcvConnection
|
||||
describe "createRcvConn" testCreateRcvConn
|
||||
describe "createSndConn" testCreateSndConn
|
||||
|
||||
testCreateRcvConnection :: SpecWith SQLiteStore
|
||||
testCreateRcvConnection = do
|
||||
it "should create connection and return connection data type" $ \store -> do
|
||||
testCreateRcvConn :: SpecWith SQLiteStore
|
||||
testCreateRcvConn = do
|
||||
it "should create receiver connection and return receiver connection data type" $ \store -> do
|
||||
let rcvQueue =
|
||||
ReceiveQueue
|
||||
{ server = SMPServer "smp.simplex.im" (Just "5223") (Just "1234"),
|
||||
@@ -41,3 +42,19 @@ testCreateRcvConnection = do
|
||||
}
|
||||
createRcvConn store "1" rcvQueue
|
||||
`shouldReturn` Right (ReceiveConnection "1" rcvQueue)
|
||||
|
||||
testCreateSndConn :: SpecWith SQLiteStore
|
||||
testCreateSndConn = do
|
||||
it "should create sender connection and return sender connection data type" $ \store -> do
|
||||
let sndQueue =
|
||||
SendQueue
|
||||
{ server = SMPServer "smp.simplex.im" (Just "5223") (Just "1234"),
|
||||
sndId = "5678",
|
||||
sndPrivateKey = "abcd",
|
||||
encryptKey = "dcba",
|
||||
signKey = "edcb",
|
||||
status = New,
|
||||
ackMode = AckMode On
|
||||
}
|
||||
createSndConn store "2" sndQueue
|
||||
`shouldReturn` Right (SendConnection "2" sndQueue)
|
||||
Reference in new issue
Block a user