File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
test/Exceptionless.Tests/Storage Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 11using Exceptionless . Storage ;
2+ using Xunit ;
23using Xunit . Abstractions ;
34
45namespace Exceptionless . Tests . Storage {
@@ -8,5 +9,22 @@ public InMemoryFileStorageTests(ITestOutputHelper output) : base(output) { }
89 protected override IObjectStorage GetStorage ( ) {
910 return new InMemoryObjectStorage ( ) ;
1011 }
12+
13+ [ Fact ]
14+ public void SaveObject_AddObject_WillRespectMaxItems ( ) {
15+ // Assign
16+ var storage = new InMemoryObjectStorage ( 2 ) ;
17+ storage . SaveObject ( "1.json" , "1" ) ;
18+ storage . SaveObject ( "2.json" , "2" ) ;
19+
20+ // Act
21+ storage . SaveObject ( "3.json" , "3" ) ;
22+
23+ // Assert
24+ Assert . Equal ( storage . MaxObjects , storage . Count ) ;
25+ Assert . False ( storage . Exists ( "1.json" ) ) ;
26+ Assert . True ( storage . Exists ( "2.json" ) ) ;
27+ Assert . True ( storage . Exists ( "3.json" ) ) ;
28+ }
1129 }
1230}
You can’t perform that action at this time.
0 commit comments