Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 724113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:11:06+00:00 2026-05-14T06:11:06+00:00

[EDIT] Based on feedback yes, VS2010 seems to support SL4 Library TDD despite a

  • 0

[EDIT] Based on feedback yes, VS2010 seems to support SL4 Library TDD despite a couple strange messages when first creating the tests which said the test could not target Silverlight – problem seemed to go away – chalk it up to an RC bug I guess. I think my real out-standing question now is how to TDD a standalone library that uses elevated OOB functionality. The UI piece is not really needed for the Library development and gets in the way of what I actually want to TDD. I know I can (and will) mock some of that functionality but at some point I will also need the real thing in my tests.Thoughts?

[Original Question] First I am glad to see better TDD support in VS2010. Support for generating code stubs from my tests is ok – not as good as more mature TDD plug-ins but a good start.

I am looking for some best Silverlight 4.0 TDD practices. First Question: Anyone have links, recommendations? I know the new Silverlight Unit Test capabilities are much better (Jeff Wilcox’s Mix Presentation). What I am focusing on right now is using TDD to develop pure Silverlight 4.0 Class Library projects – projects without a Silverlight UI project. I’ve been able to get it to work but not as cleanly as it should be.

I can create an Empty VS project.

Add A Silverlight 4 Class Library Project.

Add a TestProject (not a silverlight Unit Test Project but a plain Test Project).

Add a simple test in the Test Project such as:

namespace Calculator.Test
{
    [TestClass]
    public class CalculatorTests
    {
        [TestMethod]
        public void CalulatorAddTest() {
            Calc c = new Calc();

            int expected = 10;
            int actual = c.Add(6, 4);

            Assert.AreEqual<int>(expected, actual);
        }
    }
}

Using the new Generate Type and Method from Test feature it will generate the following code in the Silverlight Project:

namespace Calculator
{
    public class Calc
    {
        public int Add(int p, int p_2) {
            throw new NotImplementedException();
        }
    }
}

When I run the tests the first time it says the target assembly is Silverlight and not able to run test – Not exact text but the same general idea.

When I change the implementation to:

namespace Calculator
{
    public class Calc
    {
        public int Add(int p, int p_2) {
            return p + p_2;
        }
    }
}

and re-run the test, it works fine and the test goes green. It also works for all other TDD code I generate after. I also get a warning Mark in the Test Project’s reference to the Calculator Silverlight Class Library Assembly.

Second Question: Any comments ideas if this just a bug in VS2010 RC or is Silverlight Class Library TDD not really supported. I have not created a Silverlight UI project or changed and build or debug settings so I have no idea what is hosting the silverlight DLL.

Finally, some of the Silverlight Class Libraries I need to write will provide functionality that requires elevated Out-Of-Browser rights. Based on the above, it looks like I can use TDD Test Projects against regular Silverlight 4.0 Class Libraries, but I have no idea how I can TDD the elevated OOB functionality without also creating the UI component that gets installed. The UI piece is not really needed for the Library development and gets in the way of what I actually want to TDD. I know I can (and will) mock some of that functionality but at some point I will also need the real thing in my tests. Third Question: Any ideas how to TDD Silverlight 4.0 Class Library project that requires OOB elevated rights?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:11:06+00:00Added an answer on May 14, 2026 at 6:11 am

    TDD is for sure supported for SL4, what i suggest is to look at source code of MEF or CAL for SL4

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT : based on feedback, erased original Q. completely and reposting in better language
I would like to display certain meta data fields in the edit form based
Edit: This question was written in 2008, which was like 3 internet ages ago.
Edit: From another question I provided an answer that has links to a lot
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
EDIT: Learned that Webmethods actually uses NLST, not LIST, if that matters Our business
EDIT: This question is more about language engineering than C++ itself. I used C++
EDIT What small things which are too easy to overlook do I need to
Edit : Solved, there was a trigger with a loop on the table (read
edit #2: Question solved halfways. Look below As a follow-up question, does anyone know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.