예제 #1
0
        public void NullTestArtist()
        {
            MRecord record1 = new MRecord("123456781", "Henrik Nielsen", "IDK", "3:40", 2019, "IP Records");

            Assert.AreEqual(record1.Artist, "Henrik Nielsen");
            MRecord record = new MRecord("123456781", null, "IDK", "3:40", 2019, "IP Records");

            _controller.Put("123456789", record);
        }
예제 #2
0
        public void Delete(string id)
        {
            MRecord record = Get(id);

            if (record != null)
            {
                records.Remove(record);
            }
        }
예제 #3
0
        public void DeleteTest()
        {
            MRecord testRecord = _controller.Get("123456789");

            Assert.AreEqual(testRecord.Title, "Be I G");
            _controller.Delete("123456789");
            MRecord testRecord2 = _controller.Get("123456789");

            Assert.AreEqual(testRecord2, null);
        }
예제 #4
0
        public void PutTest()
        {
            MRecord old     = _controller.Get("234567891");
            MRecord altered = new MRecord("234567891", "TEST", "TEST", "20:12", 1999, "TEST");

            _controller.Put("234567891", altered);
            MRecord newRecord = _controller.Get("234567891");

            Assert.AreEqual("TEST", newRecord.Title);
        }
예제 #5
0
        public void PostTest()
        {
            MRecord added  = new MRecord("456328795", "steve", "kek", "2:30", 1993, "testPub");
            int     amount = _controller.Get().Count();

            _controller.Post(added);
            Assert.AreNotEqual(amount, _controller.Get().Count());
            MRecord getVal = _controller.Get("456328795");

            Assert.AreEqual(added, getVal);
        }
예제 #6
0
 public void Post([FromBody] MRecord value)
 {
     if (records.Find(record => record.Id == value.Id) == null)
     {
         records.Add(value);
     }
     else
     {
         throw new ArgumentException("Bollocks");
     }
 }
예제 #7
0
        public void Put(string id, [FromBody] MRecord value)
        {
            MRecord record = Get(id);

            if (record != null)
            {
                record.Id        = value.Id;
                record.Title     = value.Title;
                record.Artist    = value.Artist;
                record.Duration  = value.Duration;
                record.Publisher = value.Publisher;
                record.YearOPub  = value.YearOPub;
            }
        }
 public void Record(string name, int star, int score)
 {
     MRecord r;
     if(!Records.ContainsKey(name))
     {
         r = new MRecord() { Star = star, HighScore = score };
         Records.Add(name, r);
     }
     else
     {
         r = Records[name];
         r.HighScore = score;
         r.Star = star;
     }
 }
예제 #9
0
        /// <summary>
        /// Gets the result message data.
        /// </summary>
        /// <param name="resultData">The result data.</param>
        /// <returns></returns>
        private static string GetResultMessageData(string resultData)
        {
            List <string> resultsDataList = new List <string>();
            List <string> errorCodes      = new List <string>();

            for (int index = 0; index < resultData.Length; index = index + 200)
            {
                resultsDataList.Add(resultData.Substring(index, 200));
            }

            foreach (string result in resultsDataList)
            {
                switch (result.Substring(0, 1).ToUpper(CultureInfo.InvariantCulture))
                {
                case "M":
                    MRecord mRecord = new MRecord().Convert(result);
                    errorCodes = errorCodes.Union(mRecord.ClaimRejectionReasons.Union(mRecord.ClaimDenialReasons)
                                                  .Union(mRecord.ClaimBackToProviderReasons)).ToList();
                    break;

                case "N":
                    NRecord nRecord = new NRecord().Convert(result);
                    errorCodes = errorCodes.Union(nRecord.ClaimSuspensionReasons.Union(nRecord.LineRejectionReasons)
                                                  .Union(nRecord.LineDenialReasons)).ToList();
                    break;

                case "O":
                    ORecord oRecord = new ORecord().Convert(result);
                    errorCodes = errorCodes.Union(oRecord.Diagnosis1.Union(oRecord.Diagnosis2)
                                                  .Union(oRecord.Diagnosis3).Union(oRecord.Diagnosis4).Union(oRecord.Diagnosis5)).ToList();
                    break;

                case "R":
                    RRecord rRecord = new RRecord().Convert(result);
                    errorCodes = errorCodes.Union(rRecord.ProcedureEdits).ToList();
                    break;

                case "S":
                    SRecord sRecord = new SRecord().Convert(result);
                    errorCodes = errorCodes.Union(sRecord.Modifier1.Union(sRecord.Modifier2)
                                                  .Union(sRecord.Modifier3).Union(sRecord.Modifier4).Union(sRecord.Modifier5).Union(sRecord.DateEdit).Union(sRecord.RevenueEdit)).ToList();
                    break;
                }
            }
            return(FilteredCodes(errorCodes));
        }
예제 #10
0
    public void Record(string name, int star, int score)
    {
        MRecord r;

        if (!Records.ContainsKey(name))
        {
            r = new MRecord()
            {
                Star = star, HighScore = score
            };
            Records.Add(name, r);
        }
        else
        {
            r           = Records[name];
            r.HighScore = score;
            r.Star      = star;
        }
    }
        private void HandleNewClientAccountInNewBusinessFile(string clientAccount)
        {
            var aRecords = new List <AccountRecord>()
            {
                new AccountRecord()
                {
                    ClientAccountNumber = clientAccount
                }
            };

            var x00Record = new X00Record()
            {
                ClientAccountNumber = clientAccount
            };

            var hRecords = new List <CitiNbsHRecords>()
            {
                new CitiNbsHRecords()
                {
                    ClientAccountNumber = clientAccount
                }
            };

            var mRecord = new MRecord()
            {
                ClientAccountNumber = clientAccount
            };

            var x01Record = new X01Record()
            {
                ClientAccountNumber = clientAccount
            };

            _citiScope.citiTestService.ModifyNewBusinessAccountRecords(aRecords, _testScope.clientConfigurations.SourceFolder + _testScope.fileReceived, ARecordLineNumber);
            _citiScope.citiTestService.ModifyNewBusinessX00Record(x00Record, _testScope.clientConfigurations.SourceFolder + _testScope.fileReceived, X00RecordLineNumber);
            _citiScope.citiTestService.ModifyNewBusinessHRecords(hRecords, _testScope.clientConfigurations.SourceFolder + _testScope.fileReceived, H00RecordLineNumber);
            _citiScope.citiTestService.ModifyNewBusinessMRecord(mRecord, _testScope.clientConfigurations.SourceFolder + _testScope.fileReceived, M00RecordLineNumber);
            _citiScope.citiTestService.ModifyNewBusinessX01Record(x01Record, _testScope.clientConfigurations.SourceFolder + _testScope.fileReceived, X01RecordLineNumber);
        }
예제 #12
0
        public void ModifyNewBusinessMRecord(MRecord mRecord, string sourceFile, int lineNumber)
        {
            var serialize = new FixedWidthSerializer(typeof(MRecord));

            serialize.ModifyFields(sourceFile, mRecord, lineNumber);
        }
예제 #13
0
        public void GetIdTest()
        {
            MRecord testRecord = _controller.Get("123456789");

            Assert.AreEqual(testRecord.Title, "Be I G");
        }