Beispiel #1
0
        public void Repo_Logins_GetV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateLogins();

            var results = UoW.Logins.Get();

            results.Should().BeAssignableTo <IEnumerable <tbl_Login> >();
            results.Count().Should().Be(UoW.Logins.Count());
        }
Beispiel #2
0
        public void Repo_Logins_DeleteV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateLogins();

            var login = UoW.Logins.Get(QueryExpressionFactory.GetQueryExpression <tbl_Login>()
                                       .Where(x => x.Name == TestDefaultConstants.LoginName).ToLambda())
                        .Single();

            UoW.Logins.Delete(login);
            UoW.Commit();
        }
Beispiel #3
0
        public void Repo_Logins_UpdateV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateLogins();

            var login = UoW.Logins.Get(QueryExpressionFactory.GetQueryExpression <tbl_Login>()
                                       .Where(x => x.Name == TestDefaultConstants.LoginName).ToLambda())
                        .Single();

            login.Name += "(Updated)";

            var result = UoW.Logins.Update(login);

            UoW.Commit();

            result.Should().BeAssignableTo <tbl_Login>();
        }
Beispiel #4
0
        public void Repo_Logins_CreateV1_Success()
        {
            var data = new TestDataFactory(UoW);

            data.Destroy();
            data.CreateLogins();

            var result = UoW.Logins.Create(
                Mapper.Map <tbl_Login>(new LoginV1()
            {
                Name        = TestDefaultConstants.LoginName,
                LoginKey    = TestDefaultConstants.LoginKey,
                IsDeletable = false,
            }));

            UoW.Commit();

            result.Should().BeAssignableTo <tbl_Login>();
        }