djmnz / RestFluencing

MIT License
11 stars 4 forks source link

Init project from README exemple #7

Closed gfelot closed 5 years ago

gfelot commented 5 years ago

New to the .Net stack I was looking for something similar than Mocha/Chai in the NodeJS world to be able to test my API. This package seams to look pretty promising but I cannot reproduce the init exemple present in the README. So I added a class in my XUnit test project like so

using RestFluencing;
using Xunit.Sdk;

namespace HelloAssoApi.UnitTest.TestApiControllers
{
    [TestClass]
    public class OrganizationsControllerTest
    {

        protected RestConfiguration _configuration = null;

        [ClassInitialize]
        public void SetupCommonConfiguration()
        {
            _configuration = RestConfiguration.JsonDefault();
            _configuration.WithHeader("User-Agent", "RestFluencing Sample");
            _configuration.WithBaseUrl("https://api.github.com/");
        }
    }
}

But I don't have [ClassInitialize] available. Like I saied it's maybe a noob question but I cannot find a way to init the project properly.

djmnz commented 5 years ago

the examples are written using MSTest.

have a look here to comparison to XUnit https://xunit.github.io/docs/comparisons