public void NullUtils_GetString_Value_Success()
        {
            var reader = new StubDataReader(new StubResultSet("unit_test").AddRow("ABC"));

            reader.Read();
            Assert.AreEqual("ABC", NullUtils.GetString(reader, "unit_test"),
                            "GetString(value) did not return the expected value");
        }
        public void NullUtils_GetString_Null_Success()
        {
            var reader = new StubDataReader(new StubResultSet("unit_test").AddRow(DBNull.Value));

            reader.Read();
            Assert.AreEqual(String.Empty, NullUtils.GetString(reader, "unit_test"),
                            "GetString(null) should have returned an empty string");
        }
            protected override EmojiModel MapRow(SQLiteDataReader reader)
            {
                EmojiModel model = new EmojiModel();

                model.Total = NullUtils.GetInt(reader, reader.GetOrdinal("total"), 0);
                model.Emoji = NullUtils.GetString(reader, reader.GetOrdinal("emoji"));


                return(model);
            }
Beispiel #4
0
            protected override UrlModel MapRow(SQLiteDataReader reader)
            {
                UrlModel model = new UrlModel();

                model.Domain = NullUtils.GetString(reader, reader.GetOrdinal("hostname"));
                model.Total  = NullUtils.GetInt(reader, reader.GetOrdinal("total"), 0);


                return(model);
            }
Beispiel #5
0
            protected override HashtagModel MapRow(SQLiteDataReader reader)
            {
                HashtagModel model = new HashtagModel();

                model.Total = NullUtils.GetInt(reader, reader.GetOrdinal("total"), 0);
                model.Tag   = NullUtils.GetString(reader, reader.GetOrdinal("tag"));


                return(model);
            }
            protected override MentionModel MapRow(SQLiteDataReader reader)
            {
                MentionModel model = new MentionModel();

                model.Total = NullUtils.GetInt(reader, reader.GetOrdinal("total"), 0);
                model.User  = NullUtils.GetString(reader, reader.GetOrdinal("user"));


                return(model);

                throw new NotImplementedException();
            }
Beispiel #7
0
            protected override LanguageModel MapRow(SQLiteDataReader reader)
            {
                LanguageModel model = new LanguageModel();

                model.Total    = NullUtils.GetInt(reader, reader.GetOrdinal("total"), 0);
                model.Language = NullUtils.GetString(reader, reader.GetOrdinal("language"));


                return(model);

                throw new NotImplementedException();
            }