Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, June 29, 2025 
 
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!
 Web Forums - SalesLogix Web Platform & Application Architect
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Unit Testing in SalesLogix
David Lumm
Posts: 87
 
Unit Testing in SalesLogixYour last visit to this thread was on 1/1/1970 12:00:00 AM
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

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Unit Testing in SalesLogixYour last visit to this thread was on 1/1/1970 12:00:00 AM
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 Wink)


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 Laughing

[Reply][Quote]
David Lumm
Posts: 87
 
Re: Unit Testing in SalesLogixYour last visit to this thread was on 1/1/1970 12:00:00 AM
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! Smile


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 Embarassed


I'll look forward to your article on unit testing!

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Unit Testing in SalesLogixYour last visit to this thread was on 1/1/1970 12:00:00 AM
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

[Reply][Quote]
David Lumm
Posts: 87
 
Re: Unit Testing in SalesLogixYour last visit to this thread was on 1/1/1970 12:00:00 AM
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?

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Unit Testing in SalesLogixYour last visit to this thread was on 1/1/1970 12:00:00 AM
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?

[Reply][Quote]
David Lumm
Posts: 87
 
Re: Unit Testing in SalesLogixYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 28 Oct 10 6:05 AM
fiogf49gjkf0d

Yeah, that's how I imagined it would be done.


Thanks for the confirmation!

[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/29/2025 1:40:39 PM