public void Simple_Repo_Should_Return_Integer_For_Integer_Autogenerated_Keys()
        {
            var newShwerko = new Shwerko
            {
                Name   = "Just Persist me",
                ElDate = new DateTime(2010, 1, 1)
            };

            Assert.IsType(typeof(int), _repo.Add(newShwerko));
        }
        public void Simple_Repo_Should_Implement_String_Contains()
        {
            // Arrange
            _repo.Add <Shwerko>(CreateTestRecord(Guid.NewGuid()));

            // Act
            Shwerko shwerko = _repo.Find <Shwerko>(s => s.Name.Contains("a")).FirstOrDefault();

            // Assert
            Assert.NotNull(shwerko);
        }
        private Shwerko CreateTestRecord(Guid key)
        {
            var id = key;

            var item = new Shwerko();
            item.Key = id;
            item.Name = "Charlie";
            item.ElDate = DateTime.Now;
            item.SomeNumber = 1;
            item.NullSomeNumber = 12.3M;
            item.Underscored_Column = 1;
            return item;
        }
Example #4
0
        private Shwerko CreateTestRecord(Guid key)
        {
            var id = key;

            var item = new Shwerko();

            item.Key                = id;
            item.Name               = "Charlie";
            item.ElDate             = DateTime.Now;
            item.SomeNumber         = 1;
            item.NullSomeNumber     = 12.3M;
            item.Underscored_Column = 1;
            return(item);
        }
		public void Simple_Repo_Should_Return_Integer_For_Integer_Autogenerated_Keys()
		{
			var newShwerko = new Shwerko
				{
					Name = "Just Persist me",
					ElDate = new DateTime(2010, 1, 1)
				};

			Assert.IsType(typeof (int), _repo.Add(newShwerko));
		}
        private Shwerko CreateTestRecord(Guid key, Action<Shwerko> withValuesApplied)
        {
            var id = key;

            var item = new Shwerko();
            item.Key = id;
            item.Name = "Charlie";
            item.ElDate = DateTime.Now;
            item.SomeNumber = 1;
            item.NullSomeNumber = 12.3M;
            item.Underscored_Column = 1;

            withValuesApplied(item);

            return item;
        }