#include "stream_digest.h"

#include <library/cpp/testing/unittest/registar.h>


Y_UNIT_TEST_SUITE(TRtyUtilStreamDigest) {
    Y_UNIT_TEST(TestSimpleStreamDigest) {
        const TString testString = "TestString";
        TStringStream ss;
        TMD5ProxyStream md5s(ss);
        md5s.Write(testString);
        md5s.Finish();
        UNIT_ASSERT_EQUAL(md5s.GetMD5(), MD5::Calc(testString));
        UNIT_ASSERT_EQUAL(ss.Str(), testString);
    }
}
