|
1 | | -NHtmlUnit |
2 | | -========= |
| 1 | +# NHtmlUnit |
3 | 2 |
|
4 | | -[](https://travis-ci.org/HtmlUnit/NHtmlUnit) |
| 3 | +| | **Status** | |
| 4 | +| ---------------------: | :------------------------ | |
| 5 | +| **GitHub** | [![GitHub release][1]][2] | |
| 6 | +| **NuGet** | [![NuGet][3]][4] | |
| 7 | +| **Travis** (Linux) | [![Master][5]][6] | |
| 8 | +| **AppVeyor** (Windows) | [![Master][7]][8] | |
| 9 | +| **Codefactor** | [![Codefactor][9]][10] | |
5 | 10 |
|
6 | | -NHtmlUnit is a .NET wrapper of [HtmlUnit](http://htmlunit.sourceforge.net/); |
7 | | -a "GUI-less browser for Java programs". |
8 | 11 |
|
9 | | -Introduction |
10 | | ----------- |
| 12 | +NHtmlUnit is a .NET wrapper of [HtmlUnit][htmlunit]; a "GUI-less browser for |
| 13 | +Java programs". |
11 | 14 |
|
12 | | -We really like the HtmlUnit project, which enables headless web testing without needing |
13 | | -to have a complete browser running. By using [IKVM](http://www.ikvm.net/) it is possible |
| 15 | +## Introduction |
| 16 | + |
| 17 | +We really like the HtmlUnit project, which enables headless web testing without |
| 18 | +needing to have a complete browser running. By using [IKVM][ikvm] it is possible |
14 | 19 | to convert the HtmlUnit Java library for use on Microsoft's .NET platform. |
15 | 20 |
|
16 | 21 | However, it doesn't feel very natural to use a Java library in a .NET language, |
17 | | -and therefore we created an HtmlUnit wrapper written in C#, so you can write tests for |
18 | | -your web pages in clean C# code (or any code running on the .NET platform). |
| 22 | +and therefore we created an HtmlUnit wrapper written in C#, so you can write |
| 23 | +tests for your web pages in clean C# code (or any code running on the .NET |
| 24 | +platform). |
19 | 25 |
|
20 | | -Downloading NHtmlUnit |
21 | | ---------------------- |
| 26 | +## Downloading NHtmlUnit |
22 | 27 |
|
23 | | -The recommended way to [download NHtmlUnit](https://nuget.org/packages/NHtmlUnit) is |
24 | | -through its NuGet package. If you want to build it yourself, read the next section. |
| 28 | +The recommended way to [download NHtmlUnit][nuget] is through its NuGet package. |
| 29 | +If you want to build it yourself, read the next section. |
25 | 30 |
|
26 | | -Building NHtmlUnit |
27 | | ------------------- |
| 31 | +## Building NHtmlUnit |
28 | 32 |
|
29 | | -If you want to build your own version of NHtmlUnit, you can use MSBuild or Visual Studio |
30 | | -2010. |
| 33 | +If you want to build your own version of NHtmlUnit, you can use MSBuild or |
| 34 | +Visual Studio 2010 or newer. |
31 | 35 |
|
32 | 36 | After building you can find `NHtmlUnit.dll` plus its dependencies here: |
33 | 37 |
|
34 | 38 | * `app\NHtmlUnit\bin\Debug` |
35 | 39 | * `app\NHtmlUnit\bin\Release` |
36 | 40 |
|
37 | | -Usage |
38 | | ------ |
| 41 | +## Usage |
39 | 42 |
|
40 | | -For now there is no manual or API reference written for NHtmlUnit. You can however use the |
41 | | -[HtmlUnit reference](http://htmlunit.sourceforge.net/gettingStarted.html), as this wrapper |
42 | | -almost completely reflects the original API. |
| 43 | +For now there is no manual or API reference written for NHtmlUnit. You can |
| 44 | +however use the [HtmlUnit reference][reference], as this wrapper almost |
| 45 | +completely reflects the original API. |
43 | 46 |
|
44 | | -The difference is that Java iterators, lists and collections are exposed as their |
45 | | -.NET-friendly counterparts (`IEnumerable`, `IList` and `ICollection`). In addition, |
46 | | -properties are "real" .NET properties, so `obj.getSomething()` and `obj.setSomething()` is |
47 | | -exposed as `obj.Something` with a public getter and setter. |
| 47 | +The difference is that Java iterators, lists and collections are exposed as |
| 48 | +their .NET-friendly counterparts (`IEnumerable`, `IList` and `ICollection`). In |
| 49 | +addition, properties are "real" .NET properties, so `obj.getSomething()` and |
| 50 | +`obj.setSomething()` is exposed as `obj.Something` with a public getter and |
| 51 | +setter. |
48 | 52 |
|
49 | | -NHtmlUnitGenerator |
50 | | ------------------- |
| 53 | +## NHtmlUnitGenerator |
51 | 54 |
|
52 | | -The `NHtmlUnitGenerator` executable only needs to be run when the HtmlUnit jar file has |
53 | | -changed. When `NHtmlUnitGenerator` is run it will overwrite all files in |
54 | | -`app\NHtmlUnit\Generated`. |
| 55 | +The `NHtmlUnitGenerator` executable only needs to be run when the HtmlUnit jar |
| 56 | +file has changed. When `NHtmlUnitGenerator` is run it will overwrite all files |
| 57 | +in `app\NHtmlUnit\Generated`. |
55 | 58 |
|
56 | 59 | Note that it doesn't do anything with the project files, so if classes are added or |
57 | 60 | removed from the origin HtmlUnit jar file this will not be synchronized. You have to |
58 | 61 | manually add new files to the project. |
59 | 62 |
|
60 | | -License |
61 | | -------- |
| 63 | +## License |
62 | 64 |
|
63 | 65 | NHtmlUnit is licensed under the Apache License Version 2.0, which is the same |
64 | 66 | license used for HtmlUnit. |
65 | 67 |
|
66 | | -Technical details |
67 | | ------------------ |
| 68 | +## Technical details |
| 69 | + |
| 70 | +NHtmlUnit has in large parts been auto-generated using the HtmlUnit jar file as |
| 71 | +input to the excellent [IKVM][ikvm] project. How it is generated can be seen in |
| 72 | +the `Make.cmd` file located inside the `lib/NHtmlUnit` folder. |
| 73 | + |
| 74 | +Although we consider NHtmlUnit itself to be of decent quality, the |
| 75 | +NHtmlUnitGenerator is basically a large hack. |
68 | 76 |
|
69 | | -NHtmlUnit has in large parts been auto-generated using the HtmlUnit jar file as input |
70 | | -to the excellent [IKVM](http://www.ikvm.net/) project. How it is generated can be seen |
71 | | -in the `Make.cmd` file located inside the `lib/NHtmlUnit` folder. |
| 77 | +## Future |
72 | 78 |
|
73 | | -Although we consider NHtmlUnit itself to be of decent quality, the NHtmlUnitGenerator |
74 | | -is basically a large hack. |
| 79 | +A complete rewrite of the NHtmlUnitGenerator using [Mono.Cecil][cecil] would be |
| 80 | +nice, although we're unsure exactly how much this would do for the final |
| 81 | +product. |
75 | 82 |
|
76 | | -Future |
77 | | ------- |
| 83 | +## Authours |
78 | 84 |
|
79 | | -A complete rewrite of the NHtmlUnitGenerator using [Mono.Cecil](http://www.mono-project.com/Cecil) |
80 | | -would be nice, although we're unsure exactly how much this would do for the final product. |
| 85 | +NHtmlUnit was written by @asbjornu and @beewarloc. |
81 | 86 |
|
82 | | -Authours |
83 | | --------- |
| 87 | +<!-- Footnote links: --> |
84 | 88 |
|
85 | | -NHtmlUnit was written by @asbjornu and @beewarloc. |
| 89 | +[1]: https://img.shields.io/github/release/HtmlUnit/NHtmlUnit.svg |
| 90 | +[2]: https://github.com/HtmlUnit/NHtmlUnit/releases/latest |
| 91 | +[3]: https://img.shields.io/nuget/v/NHtmlUnit.svg |
| 92 | +[4]: https://www.nuget.org/packages/NHtmlUnit |
| 93 | +[5]: https://travis-ci.org/HtmlUnit/NHtmlUnit.svg?branch=master |
| 94 | +[6]: https://travis-ci.org/HtmlUnit/NHtmlUnit |
| 95 | +[7]: https://img.shields.io/appveyor/ci/HtmlUnit/NHtmlUnit/master.svg |
| 96 | +[8]: https://ci.appveyor.com/project/HtmlUnit/NHtmlUnit/branch/master |
| 97 | +[9]: https://www.codefactor.io/repository/github/htmlunit/nhtmlunit/badge/master |
| 98 | +[10]: https://www.codefactor.io/repository/github/htmlunit/nhtmlunit/overview/master |
| 99 | +[htmlunit]: http://htmlunit.sourceforge.net/ |
| 100 | +[ikvm]: http://www.ikvm.net/ |
| 101 | +[nuget]: https://nuget.org/packages/NHtmlUnit |
| 102 | +[reference]: http://htmlunit.sourceforge.net/gettingStarted.html |
| 103 | +[cecil]: http://www.mono-project.com/Cecil |
0 commit comments