diff --git a/tests/AgentTests/SQLite.hs b/tests/AgentTests/SQLite.hs index fe395c138..06607662b 100644 --- a/tests/AgentTests/SQLite.hs +++ b/tests/AgentTests/SQLite.hs @@ -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)