Example #1
0
        public void UpdateFact()
        {
            var role = default(Role);

            try
            {
                var name = new Random().Next().ToString(CultureInfo.InvariantCulture);
                role = new Role(new RoleEntity() { Name = name, });
                role.Found += (sender, e) =>
                    {
                        var updated = new Role(e);
                        updated.Found += (sender2, e2) => Assert.True(e2.CreatedOn < e2.UpdatedOn);

                        Thread.Sleep(1000);
                        updated.Update();
                        updated.Find();
                    };

                role.Create();
                role.Find();
            }
            finally
            {
                if (role != null) { role.Delete(); }
            }
        }
Example #2
0
        public void CreateFact()
        {
            var role = default(Role);

            try
            {
                var name = new Random().Next().ToString(CultureInfo.InvariantCulture);
                role = new Role(new RoleEntity(){ Name = name, });
                role.Found += (sender, e) => Assert.True(0 < e.ID);

                role.Create();
                role.Find();
            }
            finally
            {
                if (role != null) { role.Delete(); }
            }
        }
Example #3
0
        public void DeleteFact()
        {
            var role = default(Role);

            var name = new Random().Next().ToString(CultureInfo.InvariantCulture);
            role = new Role(new RoleEntity() { Name = name, });
            role.Found += (sender, e) => Assert.False(0 < e.ID);

            role.Create();
            role.Delete();
            role.Find();
        }