コード例 #1
0
        public void Should_Get_Return_Type_Of_ExpenseEntity()
        {
            var expenseEntity = new ExpenseEntity()
            {
                Id        = 1,
                Payee     = "Toys R Us",
                Amount    = 100.00M,
                Category  = "Fun Money",
                Account   = "Suntrust",
                Date      = DateTime.Today,
                Repeat    = false,
                Impulse   = true,
                Memo      = "He-man Toys",
                ColorCode = "Pink"
            };

            var session = new Mock <ISession>();

            session.Setup(x => x.Query <ExpenseEntity>())
            .Returns(() => new List <ExpenseEntity> {
                expenseEntity
            }.AsQueryable());

            var nhibernateSession = new Mock <INHibernateSession>();

            nhibernateSession.Setup(x => x.OpenSession())
            .Returns(() => session.Object);

            var expenseData = new ExpenseQueryService(nhibernateSession.Object);

            var result = expenseData.Query(1);

            Assert.IsInstanceOf(expenseEntity.GetType(), result);
        }
        public void Should_Get_Return_Type_Of_ExpenseEntity()
        {
            var expenseResult = _sut.Modify(1, expenseInput);

            Assert.IsInstanceOf(expenseEntity.GetType(), expenseResult);
        }