예제 #1
0
        public void WHEN_LookupName_Does_Not_Exist_SHOULD_Throw_InvalidOperationException()
        {
            var repository = Container.GetMock <ILookupRepository>();

            repository.Setup(m => m.GetLookupAsync(It.IsAny <string>())).ReturnsAsync(null);
            Container.GetMock <ILookupRepositoryFactory>()
            .Setup(m => m.CreateLookupRepository(It.IsAny <LookupType>()))
            .Returns(repository.Object);


            var param = new GetLookupDisplayNameParam
            {
                LookupType  = LookupType.Customer,
                LookupName  = "Size",
                Value       = "small|medium",
                CultureInfo = new CultureInfo("fr-CA")
            };

            _lookupService.Awaiting(async ls => await ls.GetLookupDisplayNameAsync(param)).ShouldThrow <InvalidOperationException>();
        }