add createSndConn test

This commit is contained in:
Efim Poberezkin committed 2021-01-05 18:03:57 +04:00
1 parent 5d2e77f41d
commit 799d179f6f
1 file changed
+21 -4
+21 -4
View File
@@ -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)