Testing the full stack - Async

Dec 5, 2012 at 10:22 AM
Edited Dec 6, 2012 at 8:34 AM

I've got a non MVVM SL5 app using RIA.

Installed R#7.1 and AgUnit.

This works

        public void simpletest_givennothing_1equals1()
            Assert.AreEqual(1, 1);

This doesn't (seems to loop through the method once, then hang on !target.IsLoading forever).
        public void Database_GivenUserID1001_ShouldHaveOnly0Role()
            var target = new UERDomainContext();

            EnqueueCallback(() => target.Load(target.GetUsersByReviewerQuery(testUserADLogin, "AllUsers", "0")));
            EnqueueConditional(() => !target.IsLoading);

            EnqueueCallback(() => Assert.AreEqual(12, target.xyzUsers.Count()));

This tests works find in the SL Testing framework.

Ideally I'm trying drive out the Domain Services using TDD, and was trying to do it from the SL layer rather than straight against the webservices: http://stackoverflow.com/questions/13510361/ria-services-where-to-call-savechanges-from-a-test/13622463#13622463

First time testing SL.

Tried doing non async and couldn't get it to hit the db.
Dec 5, 2012 at 11:56 AM



The problem is, AgUnit right now doesn't display a visual test surface.

This is the reason a lot of the async stuff doesn't work (the UI dispatcher is suspended).

See here for more info:





Dec 6, 2012 at 8:36 AM

Many thanks Steven - directly testing the RIA layer is where I've been getting biggest wins recently.. will stick with that for a while.  http://stackoverflow.com/questions/13510361/ria-services-where-to-call-savechanges-from-a-test