Thứ Tư, 25 tháng 3, 2009

C# .Net Tools: MbUnit Test Framework


About MbUnit

The framework was first created by Jonathan 'Peli' de Halleux as a hobby project while studying for his PhD. Later Peli and Jamie Cansdale added support for MbUnit to Jamie's NUnitAddin (later it would become the TestDriven.NET addin). After Peli's departure to Microsoft in 2005 (working first as a SDET on the CLR and more recently in the Foundations for Software Engineering group in Microsoft Research) the project was opensourced under Andy Stopford.

Download

MbUnit v2.4.2 release.


License MbUnit 2.4

Copyright © 2005-2007 Andrew Stopford

Portions Copyright © 2000-2004 Jonathan De Halleux, Jamie Cansdale

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required.

2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

3. This notice may not be removed or altered from any source distribution.

License Note

This license is based on the open source zlib/libpng license. The idea was to keep the license as simple as possible to encourage use of MbUnit in free and commercial applications and libraries, but to keep the source code together and to give credit to the MbUnit contributors for their efforts. While this license allows shipping MbUnit in source and binary form, if shipping a MbUnit variant is the sole purpose of your product, please let us know.

Development

MbUnit has an active open source development team and are grateful of any support which can be provided to the project.

Documentation for the project, including how to get started developing for the framework, submitting bugs, and other important information can be found at:
http://docs.mbunit.com

They are also hosting their code at GoogleCode and SVN. This can be access by going to:
http://code.google.com/p/mb-unit/

And their bug tracking system is located at:
http://www.mertner.com/jira/

;( Not compatible with C# Express 2005 ;(

Please feel free to comfirm me with newest, more intelligences frameworks. Thanks!!

Thứ Năm, 12 tháng 3, 2009

Web PHP - Đơn giản một controller, một view

Bước kế tiếp để thao túng được CI là biết tạo các "Controller" xử lý và "View" thể hiện theo kiến trúc của CI.
Tạo một Controller đơn giản: CI framework được xây dựng trên nền php OOP, nên mỗi một controller của CI được tạo là một class với dẫn xuất gián tiếp hoặc trực tiếp từ lớp cơ bản "Controller" của CI.
- Qui cách đặt tên controller: capital first letter. Ví dụ: class MynewController extern Controller { }. Tên file lưu controller nên ở dạng lower case để phù hợp cho server window lẫn linux khi triển khai sau này. Tạo một controller đơn giản load một view đơn giản:

/* saved file name: /cibase/system/application/controller/controllerhome.php */


class ControllerHome extends Controller {

//hàm khởi dựng controller
function ControllerHome()
{
parent::Controller();
}

//hàm index truy cập mặc định controllerhome
function index()
{
$this->load->view('view_home');
}
?>
và View đơn giản:

/* saved file name: /cibase/system/application/view/view_home.php */
[html]
[head][title] A simple view of ControllerHome [/title][/head]
[body][p] Load view succeed in {elapsed_time} seconds [/p][/body]
[/html]

Cấu hình để chuyển controller mặc định khi truy cập url (http://localhost/cibase):
--> file: /cibase/system/application/config/route.phps
*line: 43 $route['default_controller'] = "welcome"; -> $route['default_controller'] = "controllerhome";

Okie, bây giờ ta truy cập lại vào địa chỉ http://localhost/cibase/ để hưởng thành quả lao động :)

Web PHP - Lập trình web PHP dễ dàng với Code Igniter - triển khai

Bắt đầu chập chững PHP, được người bạn giới thiệu framework PHP đơn giản là Code Igniter. Dưới đây là những ghi chú trong quá trình sử dụng:
Thông tin framework: http://codeigniter.com/
- Download trực tiếp: http://codeigniter.com/download.php
- Forum hỏi đáp: http://codeigniter.com/forums/
Khi download CodeIgniter về máy, bạn được tập tin CodeIgniter_{version}_.zip. Khi giải nén tập tin này, ta được 2 thư mục: "system", "user_guide" và 2 tập tin: index.php và license.txt
--> Thư mục "system" chứa toàn bộ kiến trúc framework cơ bản. Từ đây là nơi bạn bắt đầu mọi công việc lập trình Web với CodeIgniter.
--> Thư mục "user_guide" là toàn bộ hướng dẫn cơ bản của CodeIgniter cho người mới bắt đầu. Khi phát triển sản phẩm với CodeIgniter, thư mục này có thể bỏ đi.
--> Tập tin "index.php" là tập tin đầu vào mặc định cho framework CodeIgniter.
Các công cụ kèm theo để bắt đầu viết Web với CodeIgniter:
- PHP Server: xampp hoặc wamp server 2.0
- PHP Code IDE: NotePad++ hoặc Netbean 6.5 for PHP, Notepad

Tiến hành cài đặt Wamp Server 2.0, và xác định vị trí thư mục "www" của server sẽ là nơi triển khi web ở "http://localhost/"
Triển khai framework CodeIgniter:
- Giải nén tập tin CodeIgniter_{version}_.zip vào 1 thư mục (ví dụ "cibase") đặt ở trong "www".
- Cấu hình lại đường dẫn truy cập web cibase:
--> file: /cibase/system/application/config/config.php
line 14: $config['base_url'] = "http://localhost/cibase/";
Kiểm tra sự hoạt động của framework mới cài đặt:
- Mở trình duyệt web và nhập địa chỉ: "http://localhost/cibase/", nếu framework CI đã cài đặt thành công, bạn sẽ thấy kết quả tương tự trang dưới đây:Code Igniter thật đơn giản chỉ có thế.