예제 #1
0
        public async Task Should_resolve_app_by_name()
        {
            var expected = SetupApp(0, false);

            A.CallTo(() => indexByName.GetIdAsync(appId.Name))
            .Returns(appId.Id);

            var actual = await sut.GetAppByNameAsync(appId.Name);

            Assert.Same(expected, actual);
        }
예제 #2
0
        public async Task Should_resolve_app_by_name()
        {
            var(expected, _) = SetupApp();

            A.CallTo(() => indexByName.GetIdAsync(appId.Name))
            .Returns(appId.Id);

            var actual1 = await sut.GetAppByNameAsync(appId.Name, false);

            var actual2 = await sut.GetAppByNameAsync(appId.Name, false);

            Assert.Same(expected, actual1);
            Assert.Same(expected, actual2);

            A.CallTo(() => grainFactory.GetGrain <IAppGrain>(appId.Id.ToString(), null))
            .MustHaveHappenedTwiceExactly();

            A.CallTo(() => indexByName.GetIdAsync(A <string> ._))
            .MustHaveHappenedTwiceExactly();
        }