diff --git a/services/ans/test/unittest/advanced_notification_service_test.cpp b/services/ans/test/unittest/advanced_notification_service_test.cpp index e33717a07480a7241e79aa1dcd72032270539252..65738f8e4cda3d79b49547a1ccbe7feb3cb82777 100644 --- a/services/ans/test/unittest/advanced_notification_service_test.cpp +++ b/services/ans/test/unittest/advanced_notification_service_test.cpp @@ -887,34 +887,6 @@ HWTEST_F(AdvancedNotificationServiceTest, AdvancedNotificationServiceTest_10600, ASSERT_EQ(result->GetEndDate(), 0); } -/** - * @tc.number : AdvancedNotificationServiceTest_10700 - * @tc.name : ANS_GetDisturbMode_10700 - * @tc.desc : Test GetDisturbMode function - */ -HWTEST_F(AdvancedNotificationServiceTest, AdvancedNotificationServiceTest_10700, Function | SmallTest | Level1) -{ - std::chrono::system_clock::time_point timePoint = std::chrono::system_clock::now(); - timePoint = std::chrono::time_point_cast(timePoint); - timePoint += std::chrono::hours(1); - auto beginDuration = std::chrono::duration_cast(timePoint.time_since_epoch()); - int64_t beginDate = beginDuration.count(); - timePoint += std::chrono::hours(1); - auto endDuration = std::chrono::duration_cast(timePoint.time_since_epoch()); - int64_t endDate = endDuration.count(); - - sptr date = - new NotificationDoNotDisturbDate(NotificationConstant::DoNotDisturbType::ONCE, beginDate, endDate); - ASSERT_EQ((int)advancedNotificationService_->SetDoNotDisturbDate(date), (int)ERR_OK); - - sptr result = nullptr; - ASSERT_EQ((int)advancedNotificationService_->GetDoNotDisturbDate(result), (int)ERR_OK); - ASSERT_NE(result, nullptr); - ASSERT_EQ(result->GetDoNotDisturbType(), NotificationConstant::DoNotDisturbType::ONCE); - ASSERT_EQ(result->GetBeginDate(), beginDate); - ASSERT_EQ(result->GetEndDate(), endDate); -} - /** * @tc.number : AdvancedNotificationServiceTest_10800 * @tc.name : ANS_GetDisturbMode_10800 @@ -943,34 +915,6 @@ HWTEST_F(AdvancedNotificationServiceTest, AdvancedNotificationServiceTest_10800, ASSERT_EQ(result->GetEndDate(), endDate); } -/** - * @tc.number : AdvancedNotificationServiceTest_10900 - * @tc.name : ANS_GetDisturbMode_10900 - * @tc.desc : Test GetDisturbMode function - */ -HWTEST_F(AdvancedNotificationServiceTest, AdvancedNotificationServiceTest_10900, Function | SmallTest | Level1) -{ - std::chrono::system_clock::time_point timePoint = std::chrono::system_clock::now(); - timePoint = std::chrono::time_point_cast(timePoint); - timePoint += std::chrono::hours(1); - auto beginDuration = std::chrono::duration_cast(timePoint.time_since_epoch()); - int64_t beginDate = beginDuration.count(); - timePoint += std::chrono::hours(1); - auto endDuration = std::chrono::duration_cast(timePoint.time_since_epoch()); - int64_t endDate = endDuration.count(); - - sptr date = - new NotificationDoNotDisturbDate(NotificationConstant::DoNotDisturbType::CLEARLY, beginDate, endDate); - ASSERT_EQ((int)advancedNotificationService_->SetDoNotDisturbDate(date), (int)ERR_OK); - - sptr result = nullptr; - ASSERT_EQ((int)advancedNotificationService_->GetDoNotDisturbDate(result), (int)ERR_OK); - ASSERT_NE(result, nullptr); - ASSERT_EQ(result->GetDoNotDisturbType(), NotificationConstant::DoNotDisturbType::CLEARLY); - ASSERT_EQ(result->GetBeginDate(), beginDate); - ASSERT_EQ(result->GetEndDate(), endDate); -} - /** * @tc.number : AdvancedNotificationServiceTest_12900 * @tc.name : ANS_HasNotificationPolicyAccessPermission_0100