Initial Course
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#include "monadic_expected.hpp"
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(MonadicExpected, LoadUserName) {
|
||||
EXPECT_EQ(*cpp26::load_user_name("42"), "User-42");
|
||||
EXPECT_EQ(cpp26::load_user_name("x"), std::unexpected(cpp26::ErrorCode::Invalid));
|
||||
EXPECT_EQ(cpp26::load_user_name("999"), std::unexpected(cpp26::ErrorCode::NotFound));
|
||||
}
|
||||
Reference in New Issue
Block a user