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 1
1
using Exceptionless . Storage ;
2
+ using Xunit ;
2
3
using Xunit . Abstractions ;
3
4
4
5
namespace Exceptionless . Tests . Storage {
@@ -8,5 +9,22 @@ public InMemoryFileStorageTests(ITestOutputHelper output) : base(output) { }
8
9
protected override IObjectStorage GetStorage ( ) {
9
10
return new InMemoryObjectStorage ( ) ;
10
11
}
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
+ }
11
29
}
12
30
}
You can’t perform that action at this time.
0 commit comments