AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 13.01.2009, 14:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
Dynamics Mobile: Unit Testing DocumentHandlers With Parameters
Источник: http://blogs.msdn.com/dynamicsmobile...arameters.aspx
==============

In my previous post, I described how to unit test custom DocumentHandlers. When your DocumentHandler has one or more DocumentHandlerParameters, you have to manually assign values to these, since, during unit testing, the DocumentHandler instance runs outside the warm and fuzzy Mobile Server environment.

This is as simple as setting the property to the desired value before invoking the Submit or GetDocumentDescription methods.

[TestMethod] public void TestUsingMyIntegerParameter() {     // Fixture setup     string anonymousNumber = 7.ToString();     MyDocumentHandler sut = new MyDocumentHandler();     sut.MyInteger = anonymousNumber;     // Exercise system     // ...     // Verify outcome     // ...     // Teardown }
Notice how, in the above test, the MyInteger property is assigned to an Anonymous Variable before the SUT is exercised.

It's very simple, so the main purpose of this post was just to remind you that you have to remember setting all relevant properties appropriately as part of setting up your Fixture.



Источник: http://blogs.msdn.com/dynamicsmobile...arameters.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Dynamics Mobile: How to code your own barcode enabled tasklets (Motorola and Intermec devices) Blog bot DAX Blogs 1 03.06.2014 06:34
Dynamics Mobile: Unit Testing DocumentHandlers Blog bot DAX Blogs 0 07.01.2009 17:05
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
mfp: Late night discussions on software development #3: Unit testing Blog bot DAX Blogs 6 17.03.2008 12:01
Dynamics AX: Dynamics AX 4.0 - Unit Testing and Test Projects Blog bot DAX Blogs 0 28.10.2006 16:40

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 08:24.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.