forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
HowTo write unit integration tests
Demis Bellot edited this page Aug 15, 2013
·
2 revisions
[Test]
public void Test_all_REST_methods()
{
IRestClient client = new JsonServiceClient("http://localhost:5000");
List<Customer> allCustomers = client.Get(new AllCustomers());
Assert.That(allCustomers.Count, Is.EqualTo(0));
var newCustomer = client.Post(
new Customer { Name = "test", Age = 1, Email = "as@if.com" });
Assert.That(newCustomer.Id, Is.EqualTo(1));
Assert.That(newCustomer.Name, Is.EqualTo("test"));
allCustomers = client.Get(new AllCustomers());
Assert.That(allCustomers.Count, Is.EqualTo(1));
var singleCustomer = client.Get(new Customer { Id = 1 });
Assert.That(singleCustomer.Name, Is.EqualTo("test"));
singleCustomer.Name = "Update Name";
client.Put(singleCustomer);
singleCustomer = client.Get(new Customer { Id = 1 });
client.Delete(new Customer { Id = 1 });
allCustomers = client.Get(new AllCustomers());
Assert.That(allCustomers.Count, Is.EqualTo(0));
}- Why ServiceStack?
- What is a message based web service?
- Advantages of message based web services
- Why remote services should use separate DTOs
- Getting Started
- Reference
- Clients
- Formats
- View Engines 4. Razor & Markdown Razor
- Hosts
- Security
- Advanced
- Configuration options
- Access HTTP specific features in services
- Logging
- Serialization/deserialization
- Request/response filters
- Filter attributes
- Concurrency Model
- Built-in caching options
- Built-in profiling
- Form Hijacking Prevention
- Auto-Mapping
- HTTP Utils
- Virtual File System
- Config API
- Physical Project Structure
- Modularizing Services
- MVC Integration
- Plugins 3. Request logger 4. Swagger API
- Tests
- Other Languages
- Use Cases
- Performance
- How To
- Future