You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.6 KiB
C#
62 lines
1.6 KiB
C#
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using SLH.SSDMS.Common;
|
|
using SLH.SSDMS.Model.DO;
|
|
using SLH.SSDMS.Services;
|
|
using SLH.SSDMS.Services.serviceImpl;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq.Expressions;
|
|
|
|
namespace SLH.SSDMS.Test
|
|
{
|
|
[TestClass]
|
|
public class UnitTest1
|
|
{
|
|
private static IBaseServices<Base_BeltInfo> baseServices = new BaseServices<Base_BeltInfo>();
|
|
private static string last;
|
|
[TestMethod]
|
|
public void TestMethod1()
|
|
{
|
|
var code = Console.ReadLine();
|
|
test(code);
|
|
}
|
|
|
|
public string test(string code)
|
|
{
|
|
List<string> list = new List<string>();
|
|
list.Add("abc");
|
|
list.Add("123");
|
|
list.Add("456");
|
|
list.Add("789");
|
|
if (StringExtension.IsNotBlank(last))
|
|
{
|
|
int presentIndex = list.IndexOf(code);
|
|
int lastIndex = list.IndexOf(last);
|
|
|
|
if (lastIndex > 0 && presentIndex > 0 && lastIndex < presentIndex)
|
|
{
|
|
return "0";
|
|
}
|
|
|
|
if (lastIndex > 0 && presentIndex > 0 && lastIndex > presentIndex)
|
|
{
|
|
return "1";
|
|
}
|
|
|
|
if (presentIndex == 0 && lastIndex > presentIndex)
|
|
{
|
|
return "0";
|
|
}
|
|
|
|
if (presentIndex == 0 && presentIndex > lastIndex)
|
|
{
|
|
return "1";
|
|
}
|
|
}
|
|
|
|
return "";
|
|
|
|
}
|
|
}
|
|
}
|