6/29/2025 8:30:45 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
|
|
|
|
Unit Testing in SalesLogix
Posted: 22 Oct 10 10:24 AM
|
So here's a question for you intelligent and experienced folks.
Anyone used anything like nUnit or WatiN for unit testing SLX development? Our company do other C#/.net development and we're trying to bring our SLX development inline with that as much as possible, including the use of Source Control (thanks CustomerFX for your wonderful work with Git) and hopefully some unit testing.
It looks to me that nUnit probably isn't suitable in this case and WatiN will probably work, but it only looks at the website itself. Does anyone have any alternatives they've used?
Hope someone can help!
David |
|
|
|
Re: Unit Testing in SalesLogix
Posted: 22 Oct 10 10:51 AM
|
I love unit testing and use xUnit with my own custom SalesLogix development. The difficulty isn't really the unit testing, it is a bigger challenge mocking the entity objects. This isn't impossible, I've just not worked out a "best practices" for it yet (which I will do several blog posts about once I do )
One thing to keep in mind, do as little in Application Architect as possible. Meaning, don't use Code Snippets, built in business rules, etc. Instead, do everything in external assemblies. Then you can craft these assemblies in Visual Studio as you would any code. When done you link the code in the external assembly to the business rules, etc in the AppArch. Doing things this way lets you use a far better development environment and tools, but you also can easily incorporate unit tests into your development (the way it should be). Here is an article I wrote on the subject http://customerfx.com/pages/crmdeveloper/2010/05/18/using-an-external-assembly-for-entity-events-and-business-rules-in-saleslogix-web.aspx
Hopefully that helps. Another thing you have to do if you're unit testing code that uses the SLX entity model, etc, is build up the SLX stack so it is available. I have some code I've clunked together that I use for this. I am currently trying to make it generic enough and release it for others to use. It will be open soruce and hopefully isn't too far off.
BTW, glad you've enjoyed the Git articles  |
|
|
|
Re: Unit Testing in SalesLogix
Posted: 22 Oct 10 11:44 AM
|
Not just the Git articles, Git Extensions is brilliant! The whole thing has made our lives so much easier! 
You've mentioned replacing events with external assemblies, how would you go about replacing "Code Snippet Action Items" as form load events? Would you need to add anything else?
tbh we still use the C# Snippet Action Items as these are on the form and generally easier to work with 
I'll look forward to your article on unit testing! |
|
|
|
Re: Unit Testing in SalesLogix
Posted: 22 Oct 10 10:49 PM
|
fiogf49gjkf0d Hi David,
If you're not using external DLLs yet (and just using the Code Snippet Actions) you're missing out on a completely better experience developing for SalesLogix. I'd highly recommend giving it a try (review that article again). Once you start working that way, understanding how to start working in unit testing makes much more sense.
I suppose once I am done with the Git series of videos I'll do a video walkthrough of using external assemblies for that stuff (and of course once I get my bets practices figured out for entity mocking I will turn that into a series as well)
-Ryan |
|
|
|
Re: Unit Testing in SalesLogix
Posted: 23 Oct 10 4:50 AM
|
Will definitely look into using them!
How do you integrate the source code from the external dlls into Git? Just stick you VS projects into a folder next to "Model" in the workspace folder? |
|
|
|
Re: Unit Testing in SalesLogix
Posted: 23 Oct 10 11:10 AM
|
Yeah, to keep the source together with the model in the same repo, we always have the folder structure like this:
Root Model Model items Source Project1 Project2
Basically, the root contains two folders, Model and Source, which is where we place any external DLL projects. The root is the root of the repository (where the .git folder and .gitignore resides). Make sense? |
|
|
| |
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|