public void TestGetAll() { Topic topic = TopicBuilder.New().WithName("Skate").Build(); new CreateTopic().CreateNewRegister(topic); var idGet = new GetTopic().GetRegisterById(topic.Id); Assert.IsNotNull(idGet); }
public void TestCreate() { Topic topic = TopicBuilder.New().WithName("Skate").Build(); var resultValidation = new TopicValidator().Validate(topic); if (resultValidation.IsValid) { // Conhecimento MemoryCache CacheItemPolicy policy = new CacheItemPolicy(); policy.AbsoluteExpiration = DateTimeOffset.Now.AddSeconds(60); Assert.IsTrue(memoryCache.Add("topic", topic, policy)); // Produção através dos métodos new CreateTopic().CreateNewRegister(topic); var idGet = new GetTopic().GetRegisterById(topic.Id); Assert.IsNotNull(idGet); } }