Question: Using `scalatest` and Casbah, I created a test to load a bunch of documents into Mongo, and then assert that `collection.count() > 0`.

```
val collection = MongoConnection()(MY_DB)(MY_COLLECTION) 
collection.dropCollection // clear out any docs from previous test run

insert200DocumentsIntoMongo() // inserts 200 docs into the same DB and collection

assert(collection.size > 0) 

```

For multiple tests, `scalatest` throws an exception that the assert is not true.

However, after the test fails, I can clearly see in the Mongo shell that 200 documents were added to the Mongo database's collection as per the above "MY\_DB" and "MY\_COLLECTION."

```
>db.test.count()
200

```

I'm confused as to why this assert is failing since the Mongo shell demonstrates that there are 200 documents in the collection.

Also, I've tried to drop the entire database using this [post](https://stackoverflow.com/questions/8857276/how-do-i-drop-a-mongodb-database-from-the-command-line), but still the assert fails.

Answer: 
Maybe you could try something like this. 

Scan each form looking for the sender, if you don't find that name in any of the forms open a new chatbox with that sender. If you do find it then just focus on that chat box.

```
// Has sender been found
var found = false;

// get the sender ???
var sender = iRow["Sender"].ToString();

FormCollection fc = Application.OpenForms;
foreach (Form f in fc)
{
    // does the form text match our sender 
    if (f.Text == sender)
    {
        f.BringToFront();
        found = true;
        break;
    }
}

// if we did not find a form matching the sender
if ( !found )
{
    ChatBox chat = new ChatBox();
    Connection.ConnectionStrings.chatopen = sender;
    chat.Text = sender;
    chat.Show();
    chat.BringToFront();
    ChatBox.sound.playsound.Play();
}

```
What is iRow["Sender"]?

Maybe iRow["Sender"] take some unexpected value.

In another condition, you should make sure the value field of f.Text is just the value field of iRow["Sender"].ToString()