Skip to content

Commit

Permalink
moving tests to xunit
Browse files Browse the repository at this point in the history
  • Loading branch information
damienbod committed Nov 21, 2015
1 parent 3f7d5c7 commit 70b1b6a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ namespace ElasticsearchCRUD.Integration.Test

public class DefaultElasticsearchCrudTests : IDisposable
{
public DefaultElasticsearchCrudTests()
{
SetUp();
}

public void Dispose()
{
TearDown();
}

private List<SkillTestEntity> _entitiesForTests;
private List<SkillTestEntityTwo> _entitiesForTestsTypeTwo;
private readonly IElasticsearchMappingResolver _elasticsearchMappingResolver = new ElasticsearchMappingResolver();
Expand All @@ -27,7 +37,6 @@ private void WaitForDataOrFail()
}
}

[SetUp]
public void SetUp()
{
_entitiesForTests = new List<SkillTestEntity>();
Expand Down Expand Up @@ -59,7 +68,6 @@ public void SetUp()
}
}

[TearDown]
public void TearDown()
{
_entitiesForTests = null;
Expand Down Expand Up @@ -714,10 +722,5 @@ public void TestDefaultContextTestJsonIgnore()
Assert.Equal(ret.Id, 3);
}
}

public void Dispose()
{
throw new NotImplementedException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ namespace ElasticsearchCRUD.Integration.Test

public class GlobalApiTestsSearchCountTests : IDisposable
{
public GlobalApiTestsSearchCountTests()
{
Setup();
}

private readonly IElasticsearchMappingResolver _elasticsearchMappingResolver = new ElasticsearchMappingResolver();
private const string ConnectionString = "http://localhost:9200";

Expand Down Expand Up @@ -209,7 +214,6 @@ public void GlobalElasticsearchMappingSearchAllAggTest()
}
}

[TestFixtureTearDown]
public void FixtureTearDown()
{
using (var context = new ElasticsearchContext(ConnectionString, _elasticsearchMappingResolver))
Expand All @@ -227,7 +231,6 @@ public void FixtureTearDown()
}
}

[TestFixtureSetUp]
public void Setup()
{
_elasticsearchMappingResolver.AddElasticSearchMappingForEntityType(typeof(object), new GlobalElasticsearchMapping());
Expand Down Expand Up @@ -262,7 +265,7 @@ public void Setup()

public void Dispose()
{
throw new NotImplementedException();
FixtureTearDown();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ namespace ElasticsearchCRUD.Integration.Test

public class MappingTypeTests : IDisposable
{
private readonly IElasticsearchMappingResolver _elasticsearchMappingResolver = new ElasticsearchMappingResolver();
public void Dispose()
{
FixtureTearDown();
}

private readonly IElasticsearchMappingResolver _elasticsearchMappingResolver = new ElasticsearchMappingResolver();
private const string ConnectionString = "http://localhost:9200";

[TestFixtureTearDown]
public void FixtureTearDown()
{
using (var context = new ElasticsearchContext(ConnectionString, _elasticsearchMappingResolver))
Expand All @@ -39,7 +43,7 @@ public void FixtureTearDown()

}

[Fact]
[Fact]
public void CreateNewIndexAndMappingWithAllDisabled()
{
var indexDefinition = new IndexDefinition {IndexSettings = {NumberOfShards = 3, NumberOfReplicas = 1}};
Expand Down Expand Up @@ -149,11 +153,6 @@ public void CreateNewIndexAndMappingWithAnalyzer()
Assert.GreaterOrEqual(doc.PayloadResult.Hits.HitsResult.First().Id.ToString(), "1");
}
}

public void Dispose()
{
throw new NotImplementedException();
}
}

public class MappingTypeAllTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,17 @@ namespace ElasticsearchCRUD.Integration.Test

public class SearchCreateScanAndScrollTests : IDisposable
{
private List<ScanScrollTypeV1> _entitiesForTests;
public SearchCreateScanAndScrollTests()
{
SetUp();
}

public void Dispose()
{
TearDown();
}

private List<ScanScrollTypeV1> _entitiesForTests;
private readonly IElasticsearchMappingResolver _elasticsearchMappingResolver = new ElasticsearchMappingResolver();
private readonly AutoResetEvent _resetEvent = new AutoResetEvent(false);
private const string ConnectionString = "http://localhost:9200";
Expand All @@ -28,7 +38,6 @@ private void WaitForDataOrFail()
}
}

[SetUp]
public void SetUp()
{
_entitiesForTests = new List<ScanScrollTypeV1>();
Expand All @@ -48,7 +57,6 @@ public void SetUp()
}
}

[TearDown]
public void TearDown()
{
_entitiesForTests = null;
Expand Down Expand Up @@ -171,11 +179,6 @@ private string BuildSearchMatchAll()

return buildJson.ToString();
}

public void Dispose()
{
throw new NotImplementedException();
}
}

public class ScanScrollTypeV1
Expand Down

0 comments on commit 70b1b6a

Please sign in to comment.