public void GetByKeyName_with_inalid_key()
        {
            // arrange
            var mclient = GetMockClient(out Mock <IMongoCollection <PasswordStoreModel> > mcollection);
            var mrepo   = new PassStoreMongo(mclient.Object);

            // act and assert
            Assert.Throws <ArgumentNullException>(() => mrepo.GetByKeyName(" ")
                                                  .GetAwaiter().GetResult());

            Assert.Throws <ArgumentNullException>(() => mrepo.GetByKeyName(null)
                                                  .GetAwaiter().GetResult());
        }
        public void GetByKeyName_with_valid_key()
        {
            // arrange
            var mclient = GetMockClient(out Mock <IMongoCollection <PasswordStoreModel> > mcollection);
            var mrepo   = new PassStoreMongo(mclient.Object);

            // act
            var rslt = mrepo.GetByKeyName("key-1123")
                       .GetAwaiter().GetResult();

            // assert
            mclient.VerifyAll();
            mcollection.Verify(mc => mc.FindAsync(It.IsAny <FilterDefinition <PasswordStoreModel> >(),
                                                  default(FindOptions <PasswordStoreModel>), default(CancellationToken)),
                               Times.Once);
        }