Skip to content

Commit

Permalink
housekeeping: fixing failed auto-merge (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
RLittlesII authored Aug 29, 2021
1 parent 3776ef6 commit 7ed71f9
Showing 1 changed file with 0 additions and 69 deletions.
69 changes: 0 additions & 69 deletions src/ReactiveMarbles.Mvvm.Tests/ReactiveObjectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,81 +270,12 @@ public void ReactiveObjectShouldRethrowException()
// Assert.Equal("This is a test.", result.Message);
}

/// <summary>
/// Tests the memory pressure.
/// </summary>
[Fact]
public void MemoryTest_RxObject()
{
// Given
LogTotalMemory();

var thing = Enumerable.Range(0, 4000)
.Select(x => new TestFixture())
.ToList();

LogTotalMemory();
}

/// <summary>
/// Tests the memory pressure.
/// </summary>
[Fact]
public void MemoryTest_ReactiveObject()
{
// Given
LogTotalMemory();

var thing = Enumerable.Range(0, 4000)
.Select(x => new ReactiveObjectFixture())
.ToList();

LogTotalMemory();
}

/// <summary>
/// Tests the memory pressure.
/// </summary>
[Fact]
public void MemoryTest_RxLessThenReactive()
{
// Given
var first = LogTotalMemory();

var thing = Enumerable.Range(0, 4000)
.Select(x => new TestFixture())
.ToList();

var second = LogTotalMemory();
thing = null;
GC.Collect();

var thing2 = Enumerable.Range(0, 4000)
.Select(x => new ReactiveObjectFixture())
.ToList();
thing2 = null;
GC.Collect();
var third = LogTotalMemory();

second
.Should()
.BeLessThan(third);
}

private static void AssertCount(int expected, params ICollection[] collections)
{
foreach (var collection in collections)
{
Assert.Equal(expected, collection.Count);
}
}

private long LogTotalMemory()
{
GC.Collect();
var totalMemory = GC.GetTotalMemory(true);
_helper.WriteLine($"Total Memory: {totalMemory}");
return totalMemory;
}
}
}

0 comments on commit 7ed71f9

Please sign in to comment.