@@ -16,9 +16,7 @@ namespace xtd::io::tests {
1616
1717 void test_method_ (create_memory_stream) {
1818 auto stream = memory_stream {};
19- assert::is_true (stream.can_read ());
20- assert::is_true (stream.can_seek ());
21- assert::is_true (stream.can_write ());
19+ assert::are_equal (" xtd::io::memory_stream" , stream.to_string ());
2220 assert::is_zero (stream.capacity ());
2321 assert::is_zero (stream.length ());
2422 assert::is_zero (stream.position ());
@@ -28,5 +26,45 @@ namespace xtd::io::tests {
2826 assert ::throws<not_implemented_exception>([] {auto stream = memory_stream {42_z};});
2927 }
3028
29+ void test_method_ (can_read) {
30+ auto stream = memory_stream {};
31+ assert::is_true (stream.can_read ());
32+ }
33+
34+ void test_method_ (can_seek) {
35+ auto stream = memory_stream {};
36+ assert::is_true (stream.can_seek ());
37+ }
38+
39+ void test_method_ (can_write) {
40+ auto stream = memory_stream {};
41+ assert::is_true (stream.can_write ());
42+ }
43+
44+ void test_method_ (capacity) {
45+ auto stream = memory_stream {};
46+ assert::is_zero (stream.capacity ());
47+ stream.write_byte (42 );
48+ assert::is_greater_or_equal (stream.capacity (), 1_z);
49+ }
50+
51+ void test_method_ (set_capacity) {
52+ assert ::throws<not_implemented_exception>([] {memory_stream {}.capacity (42_z);});
53+ }
54+
55+ void test_method_ (length) {
56+ auto stream = memory_stream {};
57+ assert::is_zero (stream.length ());
58+ stream.write_byte (42 );
59+ assert::are_equal (1_z, stream.length ());
60+ }
61+
62+ void test_method_ (position) {
63+ auto stream = memory_stream {};
64+ assert::is_zero (stream.position ());
65+ stream.write_byte (42 );
66+ assert::are_equal (1_z, stream.position ());
67+ }
68+
3169 };
3270}
0 commit comments