message_status_counter_ut.cpp 838 B

1234567891011121314151617181920212223
  1. #include <library/cpp/testing/unittest/registar.h>
  2. #include "message_status_counter.h"
  3. #include <library/cpp/messagebus/monitoring/mon_proto.pb.h>
  4. using namespace NBus;
  5. using namespace NBus::NPrivate;
  6. Y_UNIT_TEST_SUITE(MessageStatusCounter) {
  7. Y_UNIT_TEST(MessageStatusConversion) {
  8. const ::google::protobuf::EnumDescriptor* descriptor =
  9. TMessageStatusRecord_EMessageStatus_descriptor();
  10. for (int i = 0; i < MESSAGE_STATUS_COUNT; i++) {
  11. const ::google::protobuf::EnumValueDescriptor* valueDescriptor =
  12. descriptor->FindValueByName(ToString((EMessageStatus)i));
  13. UNIT_ASSERT_UNEQUAL(valueDescriptor, nullptr);
  14. UNIT_ASSERT_EQUAL(valueDescriptor->number(), i);
  15. }
  16. UNIT_ASSERT_EQUAL(MESSAGE_STATUS_COUNT, descriptor->value_count());
  17. }
  18. }