Exemple #1
0
        public void SumMethodInFirstBusinessShouldWorks(int a, int b, int r)
        {
            IFirstBusiness firstBusiness = new FirstBusiness(null);
            int            result        = firstBusiness.Sum(a, b);

            Assert.Equal(r, result);
        }
Exemple #2
0
        public void ShuMethodShouldWorks()
        {
            IFirstBusiness firstBusiness = new FirstBusiness(null);
            int            result        = firstBusiness.Sum(1, 2);

            Assert.Equal(3, result);
        }
Exemple #3
0
        public async Task RedisShouldWorks(string user, string name, string res)
        {
            var mockDependency1 = new Mock <IRedisRepository>();

            mockDependency1.Setup(d => d.GetUser(user)).Returns(async() => await Task.Run(() => name));

            IFirstBusiness firstBusiness = new FirstBusiness(mockDependency1.Object);

            string result = await firstBusiness.UserHandlerAsync(user, name);

            Assert.Equal(res, result);
        }
Exemple #4
0
 public InternalInjectionController(FirstBusiness firstBusiness)
 {
     _firstBusiness = firstBusiness ?? throw new ArgumentNullException(nameof(firstBusiness));
 }