Example #1
0
        public void TestGetCategoryId()
        {
            _factory.Categories.Add("birds");

            int?id = new CommandBaseWrapper(_factory).GetEntityId(EntityType.Category, "birds");

            Assert.IsNotNull(id);
        }
Example #2
0
        public void TestGetLocationId()
        {
            _factory.Locations.Add("somewhere", null, null, null, null, null, null, null);

            int?id = new CommandBaseWrapper(_factory).GetEntityId(EntityType.Location, "somewhere");

            Assert.IsNotNull(id);
        }
Example #3
0
        public void TestGetWildcardCategoryId()
        {
            int?id = new CommandBaseWrapper(_factory).GetEntityId(EntityType.Category, "*");

            Assert.IsNull(id);
        }
Example #4
0
        public void TestGetInvalidDate()
        {
            DateTime?date = new CommandBaseWrapper(_factory).GetDate("gibberish");

            Assert.IsNull(date);
        }
Example #5
0
        public void TestGetDate()
        {
            DateTime?date = new CommandBaseWrapper(_factory).GetDate("2020-01-01");

            Assert.AreEqual(new DateTime(2020, 1, 1), date);
        }