Exemple #1
0
        public void Modify_AppOs_Is_Success()
        {
            //Arrange
            TResult <bool> expectedResponse = new TResult <bool>
            {
                Data    = true,
                Rtncode = FaultInfoRcConstants.OK,
                RtnMsg  = _appOsInfo.AppOSID.ToString()
            };

            _appListService.AppOsIsExisted(Arg.Any <string>(), Arg.Any <int>(), Arg.Any <string>()).Returns(new WisAppOs());
            _appListService.DisableAppOsStatusAndModifyAppOsAndPhotoAndOsOther(Arg.Any <WisAppOs>(), Arg.Any <List <WisAppPhoto> >(), Arg.Any <List <WisAppOsOther> >()).Returns(true);
            //假設新增完成後的參數值
            _appListService.GetAppOs(Arg.Any <string>()).Returns(new List <WisAppOs> {
                new WisAppOs {
                    AppOSID = _appOsInfo.AppOSID, OSType = 1, Status = true
                }
            });

            //Act
            TResult <bool> actualResponse = _targetObj.InsertOrModifyAppOs(_appOsInfo);

            //Assert
            Assert.AreEqual(expectedResponse.Data, actualResponse.Data);
            Assert.AreEqual(expectedResponse.Rtncode, actualResponse.Rtncode);
            Assert.AreEqual(expectedResponse.RtnMsg, actualResponse.RtnMsg);
        }